요약·해설과 원문, 전문 번역을 서로 분리했습니다. API 이름, symbol, source path는 원문 표기를 사용합니다.
1. 요약·해설
원문의 핵심 논리와 kernel programming 관점의 보충 설명입니다. 아래의 전문 번역과는 별도로 작성했습니다.
microcode와 MSR
special-register-buffer-data-sampling.rst:62-110shared buffer overwrite, 성능 영향과 RNGDS_MITG_DIS를 설명합니다.
제어와 상태
special-register-buffer-data-sampling.rst:111-150`srbds=` option, sysfs 상태와 기본 완화를 제공합니다.
2. 영어 원문 전체
번역 기준이 된 Linux v6.18.37 원문입니다. 줄 번호는 이 버전의 파일 좌표입니다.
원문 전체 펼치기
.. SPDX-License-Identifier: GPL-2.0
SRBDS - Special Register Buffer Data Sampling
=============================================
SRBDS is a hardware vulnerability that allows MDS
Documentation/admin-guide/hw-vuln/mds.rst techniques to
infer values returned from special register accesses. Special register
accesses are accesses to off core registers. According to Intel's evaluation,
the special register reads that have a security expectation of privacy are
RDRAND, RDSEED and SGX EGETKEY.
When RDRAND, RDSEED and EGETKEY instructions are used, the data is moved
to the core through the special register mechanism that is susceptible
to MDS attacks.
Affected processors
-------------------
Core models (desktop, mobile, Xeon-E3) that implement RDRAND and/or RDSEED may
be affected.
A processor is affected by SRBDS if its Family_Model and stepping is
in the following list, with the exception of the listed processors
exporting MDS_NO while Intel TSX is available yet not enabled. The
latter class of processors are only affected when Intel TSX is enabled
by software using TSX_CTRL_MSR otherwise they are not affected.
============= ============ ========
common name Family_Model Stepping
============= ============ ========
IvyBridge 06_3AH All
Haswell 06_3CH All
Haswell_L 06_45H All
Haswell_G 06_46H All
Broadwell_G 06_47H All
Broadwell 06_3DH All
Skylake_L 06_4EH All
Skylake 06_5EH All
Kabylake_L 06_8EH <= 0xC
Kabylake 06_9EH <= 0xD
============= ============ ========
Related CVEs
------------
The following CVE entry is related to this SRBDS issue:
============== ===== =====================================
CVE-2020-0543 SRBDS Special Register Buffer Data Sampling
============== ===== =====================================
Attack scenarios
----------------
An unprivileged user can extract values returned from RDRAND and RDSEED
executed on another core or sibling thread using MDS techniques.
Mitigation mechanism
--------------------
Intel will release microcode updates that modify the RDRAND, RDSEED, and
EGETKEY instructions to overwrite secret special register data in the shared
staging buffer before the secret data can be accessed by another logical
processor.
During execution of the RDRAND, RDSEED, or EGETKEY instructions, off-core
accesses from other logical processors will be delayed until the special
register read is complete and the secret data in the shared staging buffer is
overwritten.
This has three effects on performance:
#. RDRAND, RDSEED, or EGETKEY instructions have higher latency.
#. Executing RDRAND at the same time on multiple logical processors will be
serialized, resulting in an overall reduction in the maximum RDRAND
bandwidth.
#. Executing RDRAND, RDSEED or EGETKEY will delay memory accesses from other
logical processors that miss their core caches, with an impact similar to
legacy locked cache-line-split accesses.
The microcode updates provide an opt-out mechanism (RNGDS_MITG_DIS) to disable
the mitigation for RDRAND and RDSEED instructions executed outside of Intel
Software Guard Extensions (Intel SGX) enclaves. On logical processors that
disable the mitigation using this opt-out mechanism, RDRAND and RDSEED do not
take longer to execute and do not impact performance of sibling logical
processors memory accesses. The opt-out mechanism does not affect Intel SGX
enclaves (including execution of RDRAND or RDSEED inside an enclave, as well
as EGETKEY execution).
IA32_MCU_OPT_CTRL MSR Definition
--------------------------------
Along with the mitigation for this issue, Intel added a new thread-scope
IA32_MCU_OPT_CTRL MSR, (address 0x123). The presence of this MSR and
RNGDS_MITG_DIS (bit 0) is enumerated by CPUID.(EAX=07H,ECX=0).EDX[SRBDS_CTRL =
9]==1. This MSR is introduced through the microcode update.
Setting IA32_MCU_OPT_CTRL[0] (RNGDS_MITG_DIS) to 1 for a logical processor
disables the mitigation for RDRAND and RDSEED executed outside of an Intel SGX
enclave on that logical processor. Opting out of the mitigation for a
particular logical processor does not affect the RDRAND and RDSEED mitigations
for other logical processors.
Note that inside of an Intel SGX enclave, the mitigation is applied regardless
of the value of RNGDS_MITG_DS.
Mitigation control on the kernel command line
---------------------------------------------
The kernel command line allows control over the SRBDS mitigation at boot time
with the option "srbds=". The option for this is:
============= =============================================================
off This option disables SRBDS mitigation for RDRAND and RDSEED on
affected platforms.
============= =============================================================
SRBDS System Information
------------------------
The Linux kernel provides vulnerability status information through sysfs. For
SRBDS this can be accessed by the following sysfs file:
/sys/devices/system/cpu/vulnerabilities/srbds
The possible values contained in this file are:
============================== =============================================
Not affected Processor not vulnerable
Vulnerable Processor vulnerable and mitigation disabled
Vulnerable: No microcode Processor vulnerable and microcode is missing
mitigation
Mitigation: Microcode Processor is vulnerable and mitigation is in
effect.
Mitigation: TSX disabled Processor is only vulnerable when TSX is
enabled while this system was booted with TSX
disabled.
Unknown: Dependent on
hypervisor status Running on virtual guest processor that is
affected but with no way to know if host
processor is mitigated or vulnerable.
============================== =============================================
SRBDS Default mitigation
------------------------
This new microcode serializes processor access during execution of RDRAND,
RDSEED ensures that the shared buffer is overwritten before it is released for
reuse. Use the "srbds=off" kernel command line to disable the mitigation for
RDRAND and RDSEED.
3. 한국어 전문 번역
영어 원문의 문단 순서와 의미를 유지한 전체 번역입니다. 코드, 함수명, symbol과 URL은 원문 표기를 유지합니다.
SRBDS 개요
1-16Special Register Buffer Data Sampling(SRBDS)은 `Documentation/admin-guide/hw-vuln/mds.rst`의 MDS 기법으로 special-register access가 반환한 값을 추론할 수 있게 하는 hardware 취약점입니다. special-register access는 off-core register에 대한 access입니다.
Intel 평가에서 privacy가 기대되는 special-register read는 `RDRAND`, `RDSEED`, SGX `EGETKEY`입니다. 이 instruction을 사용하면 data가 MDS 공격에 취약한 special-register 메커니즘을 통해 core로 이동합니다.
영향받는 프로세서
17-46`RDRAND` 또는 `RDSEED`를 구현한 Core model(desktop, mobile, Xeon-E3)이 영향을 받을 수 있습니다. 아래 Family_Model·stepping이 대상입니다.
예외는 `MDS_NO`를 export하고 Intel TSX를 사용할 수 있지만 활성화하지 않은 프로세서입니다. 이 부류는 software가 `TSX_CTRL_MSR`로 Intel TSX를 활성화할 때만 영향을 받습니다.
| common name | Family_Model | Stepping |
|---|---|---|
| IvyBridge | 06_3AH | All |
| Haswell | 06_3CH | All |
| Haswell_L | 06_45H | All |
| Haswell_G | 06_46H | All |
| Broadwell_G | 06_47H | All |
| Broadwell | 06_3DH | All |
| Skylake_L | 06_4EH | All |
| Skylake | 06_5EH | All |
| Kabylake_L | 06_8EH | <= 0xC |
| Kabylake | 06_9EH | <= 0xD |
관련 CVE
47-55| CVE | 약어 | 이름 |
|---|---|---|
| CVE-2020-0543 | SRBDS | Special Register Buffer Data Sampling |
공격 시나리오
56-61권한 없는 사용자는 MDS 기법으로 다른 core 또는 sibling thread에서 실행된 `RDRAND`와 `RDSEED`의 반환 값을 추출할 수 있습니다.
microcode 완화와 성능 영향
62-94Intel microcode update는 다른 logical processor가 접근하기 전에 shared staging buffer의 secret special-register data를 덮어쓰도록 `RDRAND`, `RDSEED`, `EGETKEY`를 변경합니다. 이 instruction 실행 중 다른 logical processor의 off-core access는 special-register read와 shared-buffer overwrite가 끝날 때까지 지연됩니다.
- `RDRAND`, `RDSEED`, `EGETKEY` instruction latency가 증가합니다.
- 여러 logical processor에서 동시에 실행하는 `RDRAND`가 serialize되어 최대 RDRAND bandwidth가 줄어듭니다.
- `RDRAND`, `RDSEED`, `EGETKEY`가 다른 logical processor의 core-cache miss memory access를 지연시킵니다. legacy locked cache-line-split access와 비슷한 영향입니다.
microcode는 Intel SGX enclave 밖에서 실행되는 `RDRAND`와 `RDSEED` 완화를 끄는 opt-out `RNGDS_MITG_DIS`를 제공합니다. opt out한 logical processor에서는 instruction latency와 sibling memory-access 비용이 사라집니다.
opt-out은 enclave 내부의 `RDRAND`·`RDSEED`와 `EGETKEY`를 포함한 Intel SGX enclave에는 영향을 주지 않습니다.
IA32_MCU_OPT_CTRL MSR
95-110microcode update는 thread-scope `IA32_MCU_OPT_CTRL` MSR(address `0x123`)을 추가합니다. MSR과 `RNGDS_MITG_DIS` bit 0의 존재는 `CPUID.(EAX=07H,ECX=0).EDX[SRBDS_CTRL = 9]==1`로 열거됩니다.
logical processor에서 `IA32_MCU_OPT_CTRL[0]`을 1로 설정하면 enclave 밖의 `RDRAND`·`RDSEED` 완화만 꺼집니다. 한 logical processor의 opt out은 다른 logical processor 완화에 영향을 주지 않습니다.
Intel SGX enclave 내부에서는 원문에 `RNGDS_MITG_DS`로 표기된 값과 관계없이 완화가 적용됩니다.
srbds= command-line 제어
111-120boot time의 SRBDS 완화는 `srbds=` option으로 제어합니다.
| argument | 동작 |
|---|---|
| off | 영향받는 platform에서 RDRAND와 RDSEED의 SRBDS 완화를 비활성화합니다. |
SRBDS sysfs 상태
121-144취약점 상태는 다음 sysfs file에서 확인합니다.
/sys/devices/system/cpu/vulnerabilities/srbds
| 상태 문자열 | 의미 |
|---|---|
| Not affected | 프로세서가 취약하지 않습니다. |
| Vulnerable | 프로세서가 취약하고 완화가 비활성화되었습니다. |
| Vulnerable: No microcode | 완화 microcode가 없습니다. |
| Mitigation: Microcode | microcode 완화가 적용 중입니다. |
| Mitigation: TSX disabled | TSX가 활성화될 때만 취약한 프로세서이며 system이 TSX disabled 상태로 boot되었습니다. |
| Unknown: Dependent on hypervisor status | 영향받는 virtual guest processor에서 실행 중이지만 host가 완화되었는지 취약한지 알 수 없습니다. |
기본 완화
145-150새 microcode는 `RDRAND`와 `RDSEED` 실행 중 processor access를 serialize하고 shared buffer를 재사용하기 전에 덮어쓰도록 보장합니다. `srbds=off` kernel command line으로 RDRAND·RDSEED 완화를 끌 수 있습니다.
영향과 공격
special-register-buffer-data-sampling.rst:1-61special-register data path, 영향 CPU와 CVE를 정리합니다.