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

Linux 6.18.37 · Administration / Hardware Vulnerabilities

Linux CPU attack vector controls

시스템 신뢰 경계에 맞춰 CPU 취약점 완화를 선택하는 mitigations= 공격 벡터 제어와 취약점 대응표를 설명합니다.

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

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

1. 요약·해설

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

다섯 가지 공격 벡터

attack_vector_controls.rst:1-128

user, kernel, guest, host와 SMT sibling 사이 신뢰 경계를 나누고 각 완화의 기본 활성 상태를 설명합니다.

Command line과 취약점 표

attack_vector_controls.rst:129-236

`mitigations=` global 및 비활성화 option, 취약점별 option 우선순위와 18개 취약점의 attack vector matrix를 제공합니다.

2. 영어 원문 전체

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

원문 전체 펼치기
1 .. SPDX-License-Identifier: GPL-2.0
2
3 Attack Vector Controls
4 ======================
5
6 Attack vector controls provide a simple method to configure only the mitigations
7 for CPU vulnerabilities which are relevant given the intended use of a system.
8 Administrators are encouraged to consider which attack vectors are relevant and
9 disable all others in order to recoup system performance.
10
11 When new relevant CPU vulnerabilities are found, they will be added to these
12 attack vector controls so administrators will likely not need to reconfigure
13 their command line parameters as mitigations will continue to be correctly
14 applied based on the chosen attack vector controls.
15
16 Attack Vectors
17 --------------
18
19 There are 5 sets of attack-vector mitigations currently supported by the kernel:
20
21 #. :ref:`user_kernel`
22 #. :ref:`user_user`
23 #. :ref:`guest_host`
24 #. :ref:`guest_guest`
25 #. :ref:`smt`
26
27 To control the enabled attack vectors, see :ref:`cmdline`.
28
29 .. _user_kernel:
30
31 User-to-Kernel
32 ^^^^^^^^^^^^^^
33
34 The user-to-kernel attack vector involves a malicious userspace program
35 attempting to leak kernel data into userspace by exploiting a CPU vulnerability.
36 The kernel data involved might be limited to certain kernel memory, or include
37 all memory in the system, depending on the vulnerability exploited.
38
39 If no untrusted userspace applications are being run, such as with single-user
40 systems, consider disabling user-to-kernel mitigations.
41
42 Note that the CPU vulnerabilities mitigated by Linux have generally not been
43 shown to be exploitable from browser-based sandboxes. User-to-kernel
44 mitigations are therefore mostly relevant if unknown userspace applications may
45 be run by untrusted users.
46
47 *user-to-kernel mitigations are enabled by default*
48
49 .. _user_user:
50
51 User-to-User
52 ^^^^^^^^^^^^
53
54 The user-to-user attack vector involves a malicious userspace program attempting
55 to influence the behavior of another unsuspecting userspace program in order to
56 exfiltrate data. The vulnerability of a userspace program is based on the
57 program itself and the interfaces it provides.
58
59 If no untrusted userspace applications are being run, consider disabling
60 user-to-user mitigations.
61
62 Note that because the Linux kernel contains a mapping of all physical memory,
63 preventing a malicious userspace program from leaking data from another
64 userspace program requires mitigating user-to-kernel attacks as well for
65 complete protection.
66
67 *user-to-user mitigations are enabled by default*
68
69 .. _guest_host:
70
71 Guest-to-Host
72 ^^^^^^^^^^^^^
73
74 The guest-to-host attack vector involves a malicious VM attempting to leak
75 hypervisor data into the VM. The data involved may be limited, or may
76 potentially include all memory in the system, depending on the vulnerability
77 exploited.
78
79 If no untrusted VMs are being run, consider disabling guest-to-host mitigations.
80
81 *guest-to-host mitigations are enabled by default if KVM support is present*
82
83 .. _guest_guest:
84
85 Guest-to-Guest
86 ^^^^^^^^^^^^^^
87
88 The guest-to-guest attack vector involves a malicious VM attempting to influence
89 the behavior of another unsuspecting VM in order to exfiltrate data. The
90 vulnerability of a VM is based on the code inside the VM itself and the
91 interfaces it provides.
92
93 If no untrusted VMs, or only a single VM is being run, consider disabling
94 guest-to-guest mitigations.
95
96 Similar to the user-to-user attack vector, preventing a malicious VM from
97 leaking data from another VM requires mitigating guest-to-host attacks as well
98 due to the Linux kernel phys map.
99
100 *guest-to-guest mitigations are enabled by default if KVM support is present*
101
102 .. _smt:
103
104 Cross-Thread
105 ^^^^^^^^^^^^
106
107 The cross-thread attack vector involves a malicious userspace program or
108 malicious VM either observing or attempting to influence the behavior of code
109 running on the SMT sibling thread in order to exfiltrate data.
110
111 Many cross-thread attacks can only be mitigated if SMT is disabled, which will
112 result in reduced CPU core count and reduced performance.
113
114 If cross-thread mitigations are fully enabled ('auto,nosmt'), all mitigations
115 for cross-thread attacks will be enabled. SMT may be disabled depending on
116 which vulnerabilities are present in the CPU.
117
118 If cross-thread mitigations are partially enabled ('auto'), mitigations for
119 cross-thread attacks will be enabled but SMT will not be disabled.
120
121 If cross-thread mitigations are disabled, no mitigations for cross-thread
122 attacks will be enabled.
123
124 Cross-thread mitigation may not be required if core-scheduling or similar
125 techniques are used to prevent untrusted workloads from running on SMT siblings.
126
127 *cross-thread mitigations default to partially enabled*
128
129 .. _cmdline:
130
131 Command Line Controls
132 ---------------------
133
134 Attack vectors are controlled through the mitigations= command line option. The
135 value provided begins with a global option and then may optionally include one
136 or more options to disable various attack vectors.
137
138 Format:
139 | ``mitigations=[global]``
140 | ``mitigations=[global],[attack vectors]``
141
142 Global options:
143
144 ============ =============================================================
145 Option Description
146 ============ =============================================================
147 'off' All attack vectors disabled.
148 'auto' All attack vectors enabled, partial cross-thread mitigations.
149 'auto,nosmt' All attack vectors enabled, full cross-thread mitigations.
150 ============ =============================================================
151
152 Attack vector options:
153
154 ================= =======================================
155 Option Description
156 ================= =======================================
157 'no_user_kernel' Disables user-to-kernel mitigations.
158 'no_user_user' Disables user-to-user mitigations.
159 'no_guest_host' Disables guest-to-host mitigations.
160 'no_guest_guest' Disables guest-to-guest mitigations
161 'no_cross_thread' Disables all cross-thread mitigations.
162 ================= =======================================
163
164 Multiple attack vector options may be specified in a comma-separated list. If
165 the global option is not specified, it defaults to 'auto'. The global option
166 'off' is equivalent to disabling all attack vectors.
167
168 Examples:
169 | ``mitigations=auto,no_user_kernel``
170
171 Enable all attack vectors except user-to-kernel. Partial cross-thread
172 mitigations.
173
174 | ``mitigations=auto,nosmt,no_guest_host,no_guest_guest``
175
176 Enable all attack vectors and cross-thread mitigations except for
177 guest-to-host and guest-to-guest mitigations.
178
179 | ``mitigations=,no_cross_thread``
180
181 Enable all attack vectors but not cross-thread mitigations.
182
183 Interactions with command-line options
184 --------------------------------------
185
186 Vulnerability-specific controls (e.g. "retbleed=off") take precedence over all
187 attack vector controls. Mitigations for individual vulnerabilities may be
188 turned on or off via their command-line options regardless of the attack vector
189 controls.
190
191 Summary of attack-vector mitigations
192 ------------------------------------
193
194 When a vulnerability is mitigated due to an attack-vector control, the default
195 mitigation option for that particular vulnerability is used. To use a different
196 mitigation, please use the vulnerability-specific command line option.
197
198 The table below summarizes which vulnerabilities are mitigated when different
199 attack vectors are enabled and assuming the CPU is vulnerable.
200
201 =============== ============== ============ ============= ============== ============ ========
202 Vulnerability User-to-Kernel User-to-User Guest-to-Host Guest-to-Guest Cross-Thread Notes
203 =============== ============== ============ ============= ============== ============ ========
204 BHI X X
205 ITS X X
206 GDS X X X X * (Note 1)
207 L1TF X X * (Note 2)
208 MDS X X X X * (Note 2)
209 MMIO X X X X * (Note 2)
210 Meltdown X
211 Retbleed X X * (Note 3)
212 RFDS X X X X
213 Spectre_v1 X
214 Spectre_v2 X X
215 Spectre_v2_user X X * (Note 1)
216 SRBDS X X X X
217 SRSO X X X X
218 SSB X
219 TAA X X X X * (Note 2)
220 TSA X X X X
221 VMSCAPE X
222 =============== ============== ============ ============= ============== ============ ========
223
224 Notes:
225 1 -- Can be mitigated without disabling SMT.
226
227 2 -- Disables SMT if cross-thread mitigations are fully enabled and the CPU
228 is vulnerable
229
230 3 -- Disables SMT if cross-thread mitigations are fully enabled, the CPU is
231 vulnerable, and STIBP is not supported
232
233 When an attack-vector is disabled, all mitigations for the vulnerabilities
234 listed in the above table are disabled, unless mitigation is required for a
235 different enabled attack-vector or a mitigation is explicitly selected via a
236 vulnerability-specific command line option.
237

3. 한국어 전문 번역

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

Attack Vector Controls 개요

1-15

Attack vector control은 시스템의 예정된 용도와 관련된 CPU 취약점 완화만 구성하는 단순한 방법입니다. 관리자는 어떤 공격 벡터가 실제로 관련되는지 판단하고 나머지를 꺼서 시스템 성능을 회복하는 것이 권장됩니다.

새로운 관련 CPU 취약점이 발견되면 이 attack vector control에 추가됩니다. 따라서 선택한 공격 벡터를 기준으로 새 완화도 계속 올바르게 적용되며 관리자가 command line parameter를 다시 구성할 필요가 줄어듭니다.

지원하는 공격 벡터

16-28

커널은 현재 다섯 가지 attack-vector mitigation 집합을 지원합니다.

  • User-to-Kernel
  • User-to-User
  • Guest-to-Host
  • Guest-to-Guest
  • Cross-Thread(SMT)

활성화할 공격 벡터는 아래 `mitigations=` command line control로 지정합니다.

User-to-Kernel

29-48

user-to-kernel 공격 벡터는 악성 사용자 공간 프로그램이 CPU 취약점을 악용해 커널 데이터를 사용자 공간으로 유출하려는 경우입니다. 취약점에 따라 특정 커널 메모리만 대상일 수도 있고 시스템 전체 메모리를 포함할 수도 있습니다.

단일 사용자 시스템처럼 신뢰하지 않는 사용자 공간 애플리케이션을 실행하지 않는다면 이 완화를 끄는 방안을 고려할 수 있습니다.

Linux가 완화하는 CPU 취약점은 일반적으로 browser sandbox에서 악용 가능하다고 입증되지 않았습니다. 따라서 알 수 없는 사용자 공간 애플리케이션을 신뢰하지 않는 사용자가 실행할 수 있을 때 주로 중요합니다.

user-to-kernel 완화는 기본으로 활성화됩니다.

User-to-User

49-68

user-to-user 공격 벡터는 악성 사용자 공간 프로그램이 다른 사용자 공간 프로그램의 동작에 영향을 주어 데이터를 빼내려는 경우입니다. 프로그램의 취약성은 프로그램 자체와 제공하는 interface에 달려 있습니다.

신뢰하지 않는 사용자 공간 애플리케이션을 실행하지 않는다면 이 완화를 끄는 방안을 고려할 수 있습니다.

Linux 커널에는 전체 물리 메모리 mapping이 있으므로 악성 프로그램이 다른 프로그램의 데이터를 유출하지 못하게 완전히 보호하려면 user-to-kernel 공격도 함께 완화해야 합니다.

user-to-user 완화는 기본으로 활성화됩니다.

Guest-to-Host

69-82

guest-to-host 공격 벡터는 악성 VM이 hypervisor 데이터를 VM 안으로 유출하려는 경우입니다. 취약점에 따라 제한된 데이터만 대상일 수도 있고 시스템 전체 메모리를 포함할 수도 있습니다.

신뢰하지 않는 VM을 실행하지 않는다면 guest-to-host 완화를 끄는 방안을 고려할 수 있습니다.

KVM 지원이 있으면 guest-to-host 완화는 기본으로 활성화됩니다.

Guest-to-Guest

83-101

guest-to-guest 공격 벡터는 악성 VM이 다른 VM의 동작에 영향을 주어 데이터를 빼내려는 경우입니다. VM의 취약성은 VM 내부 코드와 제공하는 interface에 달려 있습니다.

신뢰하지 않는 VM이 없거나 VM 하나만 실행한다면 이 완화를 끄는 방안을 고려할 수 있습니다.

user-to-user와 마찬가지로 Linux kernel physical map 때문에 악성 VM이 다른 VM의 데이터를 유출하지 못하게 완전히 보호하려면 guest-to-host 공격도 함께 완화해야 합니다.

KVM 지원이 있으면 guest-to-guest 완화는 기본으로 활성화됩니다.

Cross-Thread

102-128

cross-thread 공격 벡터는 악성 사용자 공간 프로그램 또는 VM이 같은 core의 SMT sibling thread에서 실행 중인 코드를 관찰하거나 동작에 영향을 주어 데이터를 빼내는 경우입니다.

많은 cross-thread 공격은 SMT를 꺼야만 완전히 완화할 수 있으며, 이 경우 CPU core 수와 성능이 줄어듭니다.

설정동작
auto,nosmtcross-thread 공격 완화를 모두 켭니다. CPU에 존재하는 취약점에 따라 SMT도 꺼질 수 있습니다.
autocross-thread 완화를 켜지만 SMT는 끄지 않습니다.
disabledcross-thread 공격 완화를 모두 끕니다.

core scheduling 같은 기법으로 신뢰하지 않는 workload가 SMT sibling에서 함께 실행되지 않게 한다면 cross-thread 완화가 필요하지 않을 수도 있습니다.

cross-thread 완화의 기본값은 부분 활성화입니다.

mitigations= command line 제어

129-182

공격 벡터는 `mitigations=` command line option으로 제어합니다. 값은 global option으로 시작하고, 선택적으로 여러 attack vector 비활성화 option이 이어집니다.

mitigations=[global]
mitigations=[global],[attack vectors]
global option설명
off모든 공격 벡터를 끕니다.
auto모든 공격 벡터를 켜고 cross-thread 완화는 부분 활성화합니다.
auto,nosmt모든 공격 벡터와 완전한 cross-thread 완화를 켭니다.
attack vector option설명
no_user_kerneluser-to-kernel 완화를 끕니다.
no_user_useruser-to-user 완화를 끕니다.
no_guest_hostguest-to-host 완화를 끕니다.
no_guest_guestguest-to-guest 완화를 끕니다.
no_cross_thread모든 cross-thread 완화를 끕니다.

attack vector option은 쉼표 목록으로 여러 개 지정할 수 있습니다. global option을 생략하면 `auto`가 기본값입니다. `off`는 모든 공격 벡터를 끄는 것과 같습니다.

mitigations=auto,no_user_kernel
mitigations=auto,nosmt,no_guest_host,no_guest_guest
mitigations=,no_cross_thread
  • `mitigations=auto,no_user_kernel`은 user-to-kernel을 제외한 모든 벡터를 켜고 cross-thread는 부분 완화합니다.
  • `mitigations=auto,nosmt,no_guest_host,no_guest_guest`는 guest-to-host와 guest-to-guest를 제외한 모든 벡터와 완전한 cross-thread 완화를 켭니다.
  • `mitigations=,no_cross_thread`는 cross-thread를 제외한 모든 벡터를 켭니다. 비어 있는 global 위치는 기본값 `auto`를 사용합니다.

취약점별 option과의 상호작용

183-200

`retbleed=off` 같은 취약점별 control이 모든 attack vector control보다 우선합니다. 개별 취약점 완화는 attack vector 설정과 관계없이 해당 command line option으로 켜거나 끌 수 있습니다.

attack vector control 때문에 취약점을 완화할 때는 그 취약점의 기본 mitigation option을 사용합니다. 다른 완화를 쓰려면 취약점별 command line option을 지정해야 합니다.

아래 표는 CPU가 취약하다고 가정할 때 각 attack vector가 활성화되면 어떤 취약점을 완화하는지 요약합니다.

공격 벡터별 취약점 완화표

201-236
Attack vector mitigation matrix
취약점User→KernelUser→UserGuest→HostGuest→GuestCross-Thread비고
BHIXX
ITSXX
GDSXXXX*Note 1
L1TFXX*Note 2
MDSXXXX*Note 2
MMIOXXXX*Note 2
MeltdownX
RetbleedXX*Note 3
RFDSXXXX
Spectre_v1X
Spectre_v2XX
Spectre_v2_userXX*Note 1
SRBDSXXXX
SRSOXXXX
SSBX
TAAXXXX*Note 2
TSAXXXX
VMSCAPEX
undefinedundefined
undefinedundefined
undefinedundefined

X는 해당 attack vector가 취약점 완화를 활성화함을 뜻하고, *는 cross-thread 조건부 완화를 뜻합니다.

attack vector를 끄면 위 표의 해당 취약점 완화가 모두 꺼집니다. 단, 다른 활성 attack vector에도 완화가 필요하거나 취약점별 command line option으로 완화를 명시한 경우는 예외입니다.