← Documents Documentation/admin-guide/hw-vuln/l1d_flush.rst GitHub 원문 ↗

Linux 6.18.37 · Administration / Hardware Vulnerabilities

L1D Flushing

context switch의 opt-in L1D cache flush, hardware 요구 사항과 SMT 제한을 설명합니다.

Source pathDocumentation/admin-guide/hw-vuln/l1d_flush.rst
Source versionLinux v6.18.37
TranslationDUJINLABS 전문 번역 + 해설

요약·해설과 원문, 전문 번역을 서로 분리했습니다. API 이름, symbol, source path는 원문 표기를 사용합니다.

1. 요약·해설

원문의 핵심 논리와 kernel programming 관점의 보충 설명입니다. 아래의 전문 번역과는 별도로 작성했습니다.

opt-in 완화

l1d_flush.rst:1-56

`PR_SET_L1D_FLUSH`와 `l1d_flush=on`으로 process address-space 전환 시 L1D를 지우는 동작을 설명합니다.

SMT 제한

l1d_flush.rst:57-69

sibling thread 동시 실행은 보호하지 못하며 잘못 배치된 opt-in task에는 `SIGBUS`가 전달됩니다.

2. 영어 원문 전체

번역 기준이 된 Linux v6.18.37 원문입니다. 줄 번호는 이 버전의 파일 좌표입니다.

원문 전체 펼치기
1 L1D Flushing
2 ============
3
4 With an increasing number of vulnerabilities being reported around data
5 leaks from the Level 1 Data cache (L1D) the kernel provides an opt-in
6 mechanism to flush the L1D cache on context switch.
7
8 This mechanism can be used to address e.g. CVE-2020-0550. For applications
9 the mechanism keeps them safe from vulnerabilities, related to leaks
10 (snooping of) from the L1D cache.
11
12
13 Related CVEs
14 ------------
15 The following CVEs can be addressed by this
16 mechanism
17
18 ============= ======================== ==================
19 CVE-2020-0550 Improper Data Forwarding OS related aspects
20 ============= ======================== ==================
21
22 Usage Guidelines
23 ----------------
24
25 Please see document: :ref:`Documentation/userspace-api/spec_ctrl.rst
26 <set_spec_ctrl>` for details.
27
28 **NOTE**: The feature is disabled by default, applications need to
29 specifically opt into the feature to enable it.
30
31 Mitigation
32 ----------
33
34 When PR_SET_L1D_FLUSH is enabled for a task a flush of the L1D cache is
35 performed when the task is scheduled out and the incoming task belongs to a
36 different process and therefore to a different address space.
37
38 If the underlying CPU supports L1D flushing in hardware, the hardware
39 mechanism is used, software fallback for the mitigation, is not supported.
40
41 Mitigation control on the kernel command line
42 ---------------------------------------------
43
44 The kernel command line allows to control the L1D flush mitigations at boot
45 time with the option "l1d_flush=". The valid arguments for this option are:
46
47 ============ =============================================================
48 on Enables the prctl interface, applications trying to use
49 the prctl() will fail with an error if l1d_flush is not
50 enabled
51 ============ =============================================================
52
53 By default the mechanism is disabled.
54
55 Limitations
56 -----------
57
58 The mechanism does not mitigate L1D data leaks between tasks belonging to
59 different processes which are concurrently executing on sibling threads of
60 a physical CPU core when SMT is enabled on the system.
61
62 This can be addressed by controlled placement of processes on physical CPU
63 cores or by disabling SMT. See the relevant chapter in the L1TF mitigation
64 document: :ref:`Documentation/admin-guide/hw-vuln/l1tf.rst <smt_control>`.
65
66 **NOTE** : The opt-in of a task for L1D flushing works only when the task's
67 affinity is limited to cores running in non-SMT mode. If a task which
68 requested L1D flushing is scheduled on a SMT-enabled core the kernel sends
69 a SIGBUS to the task.
70

3. 한국어 전문 번역

영어 원문의 문단 순서와 의미를 유지한 전체 번역입니다. 코드, 함수명, symbol과 URL은 원문 표기를 유지합니다.

L1D flushing 개요

1-11

Level 1 Data cache(L1D)의 데이터 누출과 관련된 취약점 보고가 늘어남에 따라 커널은 context switch 때 L1D cache를 flush하는 opt-in 메커니즘을 제공합니다.

이 메커니즘은 예를 들어 `CVE-2020-0550`을 다룰 수 있습니다. application 관점에서는 L1D cache를 엿보아 데이터가 누출되는 종류의 취약점으로부터 application을 보호합니다.

관련 CVE

12-22
CVE문제범위
CVE-2020-0550Improper Data ForwardingOS related aspects

사용 지침

23-31

자세한 내용은 `Documentation/userspace-api/spec_ctrl.rst`의 `<set_spec_ctrl>` 절을 참조하십시오.

이 기능은 기본으로 비활성화되어 있습니다. application이 명시적으로 opt in해야 활성화됩니다.

완화 동작

32-42

task에 `PR_SET_L1D_FLUSH`가 활성화되어 있으면, 그 task가 schedule out되고 들어오는 task가 다른 process, 즉 다른 address space에 속할 때 L1D cache를 flush합니다.

기반 CPU가 hardware L1D flushing을 지원하면 hardware 메커니즘을 사용합니다. 이 완화를 위한 software fallback은 지원하지 않습니다.

kernel command line 제어

43-56

boot time의 L1D flush 완화는 `l1d_flush=` kernel command-line option으로 제어합니다.

argument동작
on`prctl` interface를 활성화합니다. `l1d_flush`가 활성화되지 않은 상태에서 application이 `prctl()`을 사용하면 error로 실패합니다.

기본적으로 이 메커니즘은 비활성화되어 있습니다.

SMT 환경의 제한

57-69

system에서 SMT가 활성화되어 있을 때 물리 CPU core의 sibling thread에서 서로 다른 process의 task가 동시에 실행되면, 이 메커니즘은 task 사이의 L1D 데이터 누출을 완화하지 못합니다.

process를 물리 CPU core에 통제된 방식으로 배치하거나 SMT를 비활성화해 이 문제를 다룰 수 있습니다. `Documentation/admin-guide/hw-vuln/l1tf.rst`의 `<smt_control>` 절을 참조하십시오.

task의 L1D flushing opt-in은 해당 task의 affinity가 non-SMT mode로 실행되는 core로 제한된 경우에만 동작합니다. L1D flushing을 요청한 task가 SMT-enabled core에 schedule되면 커널은 그 task에 `SIGBUS`를 보냅니다.