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

Linux 6.18.37 · Administration / Hardware Vulnerabilities

Processor MMIO Stale Data Vulnerabilities

MMIO stale-data propagator와 세 취약점, MSR 열거, VERW buffer clearing 및 상태 제어를 설명합니다.

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

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

1. 요약·해설

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

propagator와 취약점

processor_mmio_stale_data.rst:1-76

FBSDP·SSDP·PSDP와 DRPW·SBDS·SBDR의 data 이동 및 노출 방식을 설명합니다.

CPU와 MSR bit

processor_mmio_stale_data.rst:77-149

영향 Family_Model·stepping과 SBDR_SSDP_NO·FB_CLEAR 계열 bit를 정리합니다.

VERW 완화와 제어

processor_mmio_stale_data.rst:150-245

전환 지점별 buffer clearing, `mmio_stale_data=`와 sysfs 상태를 제공합니다.

Servicing과 SMT

processor_mmio_stale_data.rst:246-269

IPU·ESU 정의, SMT 상태 suffix와 참고 자료를 보존합니다.

2. 영어 원문 전체

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

원문 전체 펼치기
1 =========================================
2 Processor MMIO Stale Data Vulnerabilities
3 =========================================
4
5 Processor MMIO Stale Data Vulnerabilities are a class of memory-mapped I/O
6 (MMIO) vulnerabilities that can expose data. The sequences of operations for
7 exposing data range from simple to very complex. Because most of the
8 vulnerabilities require the attacker to have access to MMIO, many environments
9 are not affected. System environments using virtualization where MMIO access is
10 provided to untrusted guests may need mitigation. These vulnerabilities are
11 not transient execution attacks. However, these vulnerabilities may propagate
12 stale data into core fill buffers where the data can subsequently be inferred
13 by an unmitigated transient execution attack. Mitigation for these
14 vulnerabilities includes a combination of microcode update and software
15 changes, depending on the platform and usage model. Some of these mitigations
16 are similar to those used to mitigate Microarchitectural Data Sampling (MDS) or
17 those used to mitigate Special Register Buffer Data Sampling (SRBDS).
18
19 Data Propagators
20 ================
21 Propagators are operations that result in stale data being copied or moved from
22 one microarchitectural buffer or register to another. Processor MMIO Stale Data
23 Vulnerabilities are operations that may result in stale data being directly
24 read into an architectural, software-visible state or sampled from a buffer or
25 register.
26
27 Fill Buffer Stale Data Propagator (FBSDP)
28 -----------------------------------------
29 Stale data may propagate from fill buffers (FB) into the non-coherent portion
30 of the uncore on some non-coherent writes. Fill buffer propagation by itself
31 does not make stale data architecturally visible. Stale data must be propagated
32 to a location where it is subject to reading or sampling.
33
34 Sideband Stale Data Propagator (SSDP)
35 -------------------------------------
36 The sideband stale data propagator (SSDP) is limited to the client (including
37 Intel Xeon server E3) uncore implementation. The sideband response buffer is
38 shared by all client cores. For non-coherent reads that go to sideband
39 destinations, the uncore logic returns 64 bytes of data to the core, including
40 both requested data and unrequested stale data, from a transaction buffer and
41 the sideband response buffer. As a result, stale data from the sideband
42 response and transaction buffers may now reside in a core fill buffer.
43
44 Primary Stale Data Propagator (PSDP)
45 ------------------------------------
46 The primary stale data propagator (PSDP) is limited to the client (including
47 Intel Xeon server E3) uncore implementation. Similar to the sideband response
48 buffer, the primary response buffer is shared by all client cores. For some
49 processors, MMIO primary reads will return 64 bytes of data to the core fill
50 buffer including both requested data and unrequested stale data. This is
51 similar to the sideband stale data propagator.
52
53 Vulnerabilities
54 ===============
55 Device Register Partial Write (DRPW) (CVE-2022-21166)
56 -----------------------------------------------------
57 Some endpoint MMIO registers incorrectly handle writes that are smaller than
58 the register size. Instead of aborting the write or only copying the correct
59 subset of bytes (for example, 2 bytes for a 2-byte write), more bytes than
60 specified by the write transaction may be written to the register. On
61 processors affected by FBSDP, this may expose stale data from the fill buffers
62 of the core that created the write transaction.
63
64 Shared Buffers Data Sampling (SBDS) (CVE-2022-21125)
65 ----------------------------------------------------
66 After propagators may have moved data around the uncore and copied stale data
67 into client core fill buffers, processors affected by MFBDS can leak data from
68 the fill buffer. It is limited to the client (including Intel Xeon server E3)
69 uncore implementation.
70
71 Shared Buffers Data Read (SBDR) (CVE-2022-21123)
72 ------------------------------------------------
73 It is similar to Shared Buffer Data Sampling (SBDS) except that the data is
74 directly read into the architectural software-visible state. It is limited to
75 the client (including Intel Xeon server E3) uncore implementation.
76
77 Affected Processors
78 ===================
79 Not all the CPUs are affected by all the variants. For instance, most
80 processors for the server market (excluding Intel Xeon E3 processors) are
81 impacted by only Device Register Partial Write (DRPW).
82
83 Below is the list of affected Intel processors [#f1]_:
84
85 =================== ============ =========
86 Common name Family_Model Steppings
87 =================== ============ =========
88 HASWELL_X 06_3FH 2,4
89 SKYLAKE_L 06_4EH 3
90 BROADWELL_X 06_4FH All
91 SKYLAKE_X 06_55H 3,4,6,7,11
92 BROADWELL_D 06_56H 3,4,5
93 SKYLAKE 06_5EH 3
94 ICELAKE_X 06_6AH 4,5,6
95 ICELAKE_D 06_6CH 1
96 ICELAKE_L 06_7EH 5
97 ATOM_TREMONT_D 06_86H All
98 LAKEFIELD 06_8AH 1
99 KABYLAKE_L 06_8EH 9 to 12
100 ATOM_TREMONT 06_96H 1
101 ATOM_TREMONT_L 06_9CH 0
102 KABYLAKE 06_9EH 9 to 13
103 COMETLAKE 06_A5H 2,3,5
104 COMETLAKE_L 06_A6H 0,1
105 ROCKETLAKE 06_A7H 1
106 =================== ============ =========
107
108 If a CPU is in the affected processor list, but not affected by a variant, it
109 is indicated by new bits in MSR IA32_ARCH_CAPABILITIES. As described in a later
110 section, mitigation largely remains the same for all the variants, i.e. to
111 clear the CPU fill buffers via VERW instruction.
112
113 New bits in MSRs
114 ================
115 Newer processors and microcode update on existing affected processors added new
116 bits to IA32_ARCH_CAPABILITIES MSR. These bits can be used to enumerate
117 specific variants of Processor MMIO Stale Data vulnerabilities and mitigation
118 capability.
119
120 MSR IA32_ARCH_CAPABILITIES
121 --------------------------
122 Bit 13 - SBDR_SSDP_NO - When set, processor is not affected by either the
123 Shared Buffers Data Read (SBDR) vulnerability or the sideband stale
124 data propagator (SSDP).
125 Bit 14 - FBSDP_NO - When set, processor is not affected by the Fill Buffer
126 Stale Data Propagator (FBSDP).
127 Bit 15 - PSDP_NO - When set, processor is not affected by Primary Stale Data
128 Propagator (PSDP).
129 Bit 17 - FB_CLEAR - When set, VERW instruction will overwrite CPU fill buffer
130 values as part of MD_CLEAR operations. Processors that do not
131 enumerate MDS_NO (meaning they are affected by MDS) but that do
132 enumerate support for both L1D_FLUSH and MD_CLEAR implicitly enumerate
133 FB_CLEAR as part of their MD_CLEAR support.
134 Bit 18 - FB_CLEAR_CTRL - Processor supports read and write to MSR
135 IA32_MCU_OPT_CTRL[FB_CLEAR_DIS]. On such processors, the FB_CLEAR_DIS
136 bit can be set to cause the VERW instruction to not perform the
137 FB_CLEAR action. Not all processors that support FB_CLEAR will support
138 FB_CLEAR_CTRL.
139
140 MSR IA32_MCU_OPT_CTRL
141 ---------------------
142 Bit 3 - FB_CLEAR_DIS - When set, VERW instruction does not perform the FB_CLEAR
143 action. This may be useful to reduce the performance impact of FB_CLEAR in
144 cases where system software deems it warranted (for example, when performance
145 is more critical, or the untrusted software has no MMIO access). Note that
146 FB_CLEAR_DIS has no impact on enumeration (for example, it does not change
147 FB_CLEAR or MD_CLEAR enumeration) and it may not be supported on all processors
148 that enumerate FB_CLEAR.
149
150 Mitigation
151 ==========
152 Like MDS, all variants of Processor MMIO Stale Data vulnerabilities have the
153 same mitigation strategy to force the CPU to clear the affected buffers before
154 an attacker can extract the secrets.
155
156 This is achieved by using the otherwise unused and obsolete VERW instruction in
157 combination with a microcode update. The microcode clears the affected CPU
158 buffers when the VERW instruction is executed.
159
160 Kernel does the buffer clearing with x86_clear_cpu_buffers().
161
162 On MDS affected CPUs, the kernel already invokes CPU buffer clear on
163 kernel/userspace, hypervisor/guest and C-state (idle) transitions. No
164 additional mitigation is needed on such CPUs.
165
166 For CPUs not affected by MDS or TAA, mitigation is needed only for the attacker
167 with MMIO capability. Therefore, VERW is not required for kernel/userspace. For
168 virtualization case, VERW is only needed at VMENTER for a guest with MMIO
169 capability.
170
171 Mitigation points
172 -----------------
173 Return to user space
174 ^^^^^^^^^^^^^^^^^^^^
175 Same mitigation as MDS when affected by MDS/TAA, otherwise no mitigation
176 needed.
177
178 C-State transition
179 ^^^^^^^^^^^^^^^^^^
180 Control register writes by CPU during C-state transition can propagate data
181 from fill buffer to uncore buffers. Execute VERW before C-state transition to
182 clear CPU fill buffers.
183
184 Guest entry point
185 ^^^^^^^^^^^^^^^^^
186 Same mitigation as MDS when processor is also affected by MDS/TAA, otherwise
187 execute VERW at VMENTER only for MMIO capable guests. On CPUs not affected by
188 MDS/TAA, guest without MMIO access cannot extract secrets using Processor MMIO
189 Stale Data vulnerabilities, so there is no need to execute VERW for such guests.
190
191 Mitigation control on the kernel command line
192 ---------------------------------------------
193 The kernel command line allows to control the Processor MMIO Stale Data
194 mitigations at boot time with the option "mmio_stale_data=". The valid
195 arguments for this option are:
196
197 ========== =================================================================
198 full If the CPU is vulnerable, enable mitigation; CPU buffer clearing
199 on exit to userspace and when entering a VM. Idle transitions are
200 protected as well. It does not automatically disable SMT.
201 full,nosmt Same as full, with SMT disabled on vulnerable CPUs. This is the
202 complete mitigation.
203 off Disables mitigation completely.
204 ========== =================================================================
205
206 If the CPU is affected and mmio_stale_data=off is not supplied on the kernel
207 command line, then the kernel selects the appropriate mitigation.
208
209 Mitigation status information
210 -----------------------------
211 The Linux kernel provides a sysfs interface to enumerate the current
212 vulnerability status of the system: whether the system is vulnerable, and
213 which mitigations are active. The relevant sysfs file is:
214
215 /sys/devices/system/cpu/vulnerabilities/mmio_stale_data
216
217 The possible values in this file are:
218
219 .. list-table::
220
221 * - 'Not affected'
222 - The processor is not vulnerable
223 * - 'Vulnerable'
224 - The processor is vulnerable, but no mitigation enabled
225 * - 'Vulnerable: Clear CPU buffers attempted, no microcode'
226 - The processor is vulnerable but microcode is not updated. The
227 mitigation is enabled on a best effort basis.
228
229 If the processor is vulnerable but the availability of the microcode
230 based mitigation mechanism is not advertised via CPUID, the kernel
231 selects a best effort mitigation mode. This mode invokes the mitigation
232 instructions without a guarantee that they clear the CPU buffers.
233
234 This is done to address virtualization scenarios where the host has the
235 microcode update applied, but the hypervisor is not yet updated to
236 expose the CPUID to the guest. If the host has updated microcode the
237 protection takes effect; otherwise a few CPU cycles are wasted
238 pointlessly.
239 * - 'Mitigation: Clear CPU buffers'
240 - The processor is vulnerable and the CPU buffer clearing mitigation is
241 enabled.
242 * - 'Unknown: No mitigations'
243 - The processor vulnerability status is unknown because it is
244 out of Servicing period. Mitigation is not attempted.
245
246 Definitions:
247 ------------
248
249 Servicing period: The process of providing functional and security updates to
250 Intel processors or platforms, utilizing the Intel Platform Update (IPU)
251 process or other similar mechanisms.
252
253 End of Servicing Updates (ESU): ESU is the date at which Intel will no
254 longer provide Servicing, such as through IPU or other similar update
255 processes. ESU dates will typically be aligned to end of quarter.
256
257 If the processor is vulnerable then the following information is appended to
258 the above information:
259
260 ======================== ===========================================
261 'SMT vulnerable' SMT is enabled
262 'SMT disabled' SMT is disabled
263 'SMT Host state unknown' Kernel runs in a VM, Host SMT state unknown
264 ======================== ===========================================
265
266 References
267 ----------
268 .. [#f1] Affected Processors
269 https://www.intel.com/content/www/us/en/developer/topic-technology/software-security-guidance/processors-affected-consolidated-product-cpu-model.html
270

3. 한국어 전문 번역

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

Processor MMIO Stale Data 개요

1-18

Processor MMIO Stale Data는 data를 노출할 수 있는 memory-mapped I/O(MMIO) 취약점 계열입니다. 노출을 일으키는 operation sequence는 단순한 것부터 매우 복잡한 것까지 다양합니다. 대부분 공격자가 MMIO에 access해야 하므로 많은 환경은 영향을 받지 않지만, 신뢰할 수 없는 guest에 MMIO access를 제공하는 virtualization 환경은 완화가 필요할 수 있습니다.

이 취약점 자체는 transient-execution attack이 아닙니다. 다만 오래된 data를 core fill buffer로 전달할 수 있고, 이후 완화되지 않은 transient-execution attack이 그 data를 추론할 수 있습니다.

완화는 platform과 사용 모델에 따라 microcode update와 software 변경을 결합합니다. 일부 완화는 MDS 또는 SRBDS 완화와 유사합니다.

세 가지 stale-data propagator

19-52

propagator는 오래된 data가 한 microarchitectural buffer 또는 register에서 다른 곳으로 복사·이동되게 하는 operation입니다. Processor MMIO Stale Data 취약점은 오래된 data가 architectural software-visible state로 직접 읽히거나 buffer·register에서 sampling되게 할 수 있습니다.

propagator동작
Fill Buffer Stale Data Propagator (FBSDP)일부 non-coherent write에서 fill buffer(FB)의 오래된 data가 uncore의 non-coherent 부분으로 전달될 수 있습니다. 자체로는 architectural visibility를 만들지 않으며 읽기나 sampling이 가능한 위치로 추가 전달되어야 합니다.
Sideband Stale Data Propagator (SSDP)client uncore(Intel Xeon server E3 포함)에 한정됩니다. 모든 client core가 공유하는 sideband response buffer와 transaction buffer에서 요청 data 및 요청하지 않은 오래된 data를 포함한 64 byte가 core로 반환되어 core fill buffer에 남을 수 있습니다.
Primary Stale Data Propagator (PSDP)client uncore에 한정되며 primary response buffer를 모든 client core가 공유합니다. 일부 프로세서의 MMIO primary read는 요청 data와 오래된 data를 포함한 64 byte를 core fill buffer로 반환합니다.

DRPW·SBDS·SBDR 취약점

53-76
취약점CVE설명
Device Register Partial Write (DRPW)CVE-2022-21166일부 endpoint MMIO register가 register size보다 작은 write를 잘못 처리합니다. write를 중단하거나 지정 byte만 복사하지 않고 더 많은 byte를 register에 써서 FBSDP 영향 프로세서에서는 write transaction을 만든 core fill buffer의 오래된 data가 노출될 수 있습니다.
Shared Buffers Data Sampling (SBDS)CVE-2022-21125propagator가 uncore의 data를 옮겨 client core fill buffer에 복사한 뒤, MFBDS 영향 프로세서가 fill buffer data를 누출할 수 있습니다. client uncore에 한정됩니다.
Shared Buffers Data Read (SBDR)CVE-2022-21123SBDS와 비슷하지만 data가 architectural software-visible state로 직접 읽힙니다. client uncore에 한정됩니다.

영향받는 프로세서

77-112

모든 CPU가 모든 변형의 영향을 받는 것은 아닙니다. 예를 들어 Intel Xeon E3를 제외한 server 시장용 프로세서 대부분은 DRPW에만 영향을 받습니다. 영향받는 Intel 프로세서는 다음과 같습니다 `[#f1]_`.

Common nameFamily_ModelSteppings
HASWELL_X06_3FH2,4
SKYLAKE_L06_4EH3
BROADWELL_X06_4FHAll
SKYLAKE_X06_55H3,4,6,7,11
BROADWELL_D06_56H3,4,5
SKYLAKE06_5EH3
ICELAKE_X06_6AH4,5,6
ICELAKE_D06_6CH1
ICELAKE_L06_7EH5
ATOM_TREMONT_D06_86HAll
LAKEFIELD06_8AH1
KABYLAKE_L06_8EH9 to 12
ATOM_TREMONT06_96H1
ATOM_TREMONT_L06_9CH0
KABYLAKE06_9EH9 to 13
COMETLAKE06_A5H2,3,5
COMETLAKE_L06_A6H0,1
ROCKETLAKE06_A7H1

목록에 있지만 특정 변형의 영향을 받지 않는 CPU는 `MSR IA32_ARCH_CAPABILITIES`의 새 bit로 표시됩니다. 모든 변형의 완화는 대체로 `VERW`로 CPU fill buffer를 지우는 방식입니다.

IA32_ARCH_CAPABILITIES와 IA32_MCU_OPT_CTRL

113-149

새 프로세서와 기존 영향 프로세서용 microcode update에는 변형별 취약 여부와 완화 capability를 열거하는 bit가 추가되었습니다.

MSR bit의미
IA32_ARCH_CAPABILITIES bit 13 - SBDR_SSDP_NO설정되면 SBDR과 SSDP 양쪽의 영향을 받지 않습니다.
IA32_ARCH_CAPABILITIES bit 14 - FBSDP_NO설정되면 FBSDP의 영향을 받지 않습니다.
IA32_ARCH_CAPABILITIES bit 15 - PSDP_NO설정되면 PSDP의 영향을 받지 않습니다.
IA32_ARCH_CAPABILITIES bit 17 - FB_CLEAR`VERW`가 MD_CLEAR 작업의 일부로 CPU fill-buffer 값을 덮어씁니다. MDS_NO는 없지만 L1D_FLUSH와 MD_CLEAR를 모두 지원하는 CPU는 MD_CLEAR 지원에 FB_CLEAR도 암시적으로 포함합니다.
IA32_ARCH_CAPABILITIES bit 18 - FB_CLEAR_CTRL`IA32_MCU_OPT_CTRL[FB_CLEAR_DIS]` read/write를 지원합니다. 이 bit로 VERW의 FB_CLEAR 동작을 끌 수 있습니다.
IA32_MCU_OPT_CTRL bit 3 - FB_CLEAR_DIS설정되면 `VERW`가 FB_CLEAR를 수행하지 않습니다. 성능이 더 중요하거나 untrusted software에 MMIO access가 없을 때 비용을 줄일 수 있습니다. FB_CLEAR 또는 MD_CLEAR 열거 값은 바꾸지 않습니다.

FB_CLEAR를 지원하는 모든 프로세서가 FB_CLEAR_CTRL 또는 FB_CLEAR_DIS를 지원하는 것은 아닙니다.

완화 전략

150-170

MDS와 마찬가지로 모든 Processor MMIO Stale Data 변형은 공격자가 secret을 추출하기 전에 영향을 받는 buffer를 CPU가 지우도록 강제합니다. obsolete인 `VERW` 명령을 microcode update와 함께 사용하며, 커널은 `x86_clear_cpu_buffers()`로 buffer clearing을 수행합니다.

MDS 영향 CPU에서는 커널이 이미 kernel/userspace, hypervisor/guest, C-state(idle) transition에서 CPU buffer를 지우므로 추가 완화가 필요 없습니다.

MDS나 TAA의 영향을 받지 않는 CPU에서는 MMIO capability를 가진 공격자에 대해서만 완화가 필요합니다. kernel/userspace 전환에는 `VERW`가 필요 없고, virtualization에서는 MMIO capability를 가진 guest에 VMENTER할 때만 필요합니다.

완화 적용 지점

171-190
지점동작
Return to userspaceMDS/TAA의 영향을 받으면 MDS와 같은 완화를 적용하고, 아니면 완화가 필요 없습니다.
C-State transitionC-state 전환 중 CPU의 control-register write가 fill buffer data를 uncore buffer로 전달할 수 있으므로 전환 전에 `VERW`를 실행해 CPU fill buffer를 지웁니다.
Guest entry pointMDS/TAA 영향 CPU는 MDS와 같은 완화를 사용합니다. 그 외에는 MMIO-capable guest에 VMENTER할 때만 `VERW`를 실행합니다. MMIO access가 없는 guest는 secret을 추출할 수 없습니다.

mmio_stale_data= 제어

191-208

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

argument동작
fullCPU가 취약하면 userspace로 나갈 때, VM에 들어갈 때, idle transition에서 CPU buffer clearing을 활성화합니다. SMT를 자동으로 끄지는 않습니다.
full,nosmt`full`과 같고 취약 CPU에서 SMT를 비활성화합니다. 완전한 완화입니다.
off완화를 완전히 비활성화합니다.

CPU가 영향을 받고 command line에 `mmio_stale_data=off`가 없으면 커널이 적절한 완화를 선택합니다.

sysfs 완화 상태

209-245

Linux 커널은 system의 취약 여부와 활성 완화를 다음 sysfs file로 제공합니다.

/sys/devices/system/cpu/vulnerabilities/mmio_stale_data
상태 문자열의미
Not affected프로세서가 취약하지 않습니다.
Vulnerable프로세서가 취약하지만 완화가 활성화되지 않았습니다.
Vulnerable: Clear CPU buffers attempted, no microcodemicrocode가 없지만 best-effort buffer clearing을 시도합니다. host에는 update가 있고 hypervisor가 CPUID를 아직 노출하지 않은 guest 환경을 보호할 수 있지만, host에도 update가 없으면 CPU cycle만 소비합니다.
Mitigation: Clear CPU buffersCPU buffer clearing 완화가 활성화되어 있습니다.
Unknown: No mitigations프로세서가 Servicing period를 지나 취약 상태를 알 수 없고 완화도 시도하지 않습니다.

Servicing 정의와 SMT suffix

246-265

Servicing period는 Intel Platform Update(IPU) 또는 유사한 메커니즘으로 Intel processor나 platform에 functional·security update를 제공하는 과정입니다.

End of Servicing Updates (ESU)는 Intel이 IPU 등으로 Servicing을 더 이상 제공하지 않는 날짜이며, 일반적으로 분기 말에 맞춰집니다.

프로세서가 취약하면 다음 정보가 기본 상태 뒤에 붙습니다.

SMT 상태의미
SMT vulnerableSMT가 활성화되어 있습니다.
SMT disabledSMT가 비활성화되어 있습니다.
SMT Host state unknown커널이 VM에서 실행되어 host SMT 상태를 알 수 없습니다.

참고 자료

266-269

`[#f1]` Affected Processors: https://www.intel.com/content/www/us/en/developer/topic-technology/software-security-guidance/processors-affected-consolidated-product-cpu-model.html