요약·해설과 원문, 전문 번역을 서로 분리했습니다. API 이름, symbol, source path는 원문 표기를 사용합니다.
1. 요약·해설
원문의 핵심 논리와 kernel programming 관점의 보충 설명입니다. 아래의 전문 번역과는 별도로 작성했습니다.
microcode와 command line
gather_data_sampling.rst:46-78GDS 제어 bit, AVX 비활성화 대안과 `gather_data_sampling=` option을 정리합니다.
sysfs 상태
gather_data_sampling.rst:79-109취약 여부와 적용된 완화를 나타내는 sysfs file 및 상태 문자열을 보존합니다.
2. 영어 원문 전체
번역 기준이 된 Linux v6.18.37 원문입니다. 줄 번호는 이 버전의 파일 좌표입니다.
원문 전체 펼치기
.. SPDX-License-Identifier: GPL-2.0
GDS - Gather Data Sampling
==========================
Gather Data Sampling is a hardware vulnerability which allows unprivileged
speculative access to data which was previously stored in vector registers.
Problem
-------
When a gather instruction performs loads from memory, different data elements
are merged into the destination vector register. However, when a gather
instruction that is transiently executed encounters a fault, stale data from
architectural or internal vector registers may get transiently forwarded to the
destination vector register instead. This will allow a malicious attacker to
infer stale data using typical side channel techniques like cache timing
attacks. GDS is a purely sampling-based attack.
The attacker uses gather instructions to infer the stale vector register data.
The victim does not need to do anything special other than use the vector
registers. The victim does not need to use gather instructions to be
vulnerable.
Because the buffers are shared between Hyper-Threads cross Hyper-Thread attacks
are possible.
Attack scenarios
----------------
Without mitigation, GDS can infer stale data across virtually all
permission boundaries:
Non-enclaves can infer SGX enclave data
Userspace can infer kernel data
Guests can infer data from hosts
Guest can infer guest from other guests
Users can infer data from other users
Because of this, it is important to ensure that the mitigation stays enabled in
lower-privilege contexts like guests and when running outside SGX enclaves.
The hardware enforces the mitigation for SGX. Likewise, VMMs should ensure
that guests are not allowed to disable the GDS mitigation. If a host erred and
allowed this, a guest could theoretically disable GDS mitigation, mount an
attack, and re-enable it.
Mitigation mechanism
--------------------
This issue is mitigated in microcode. The microcode defines the following new
bits:
================================ === ============================
IA32_ARCH_CAPABILITIES[GDS_CTRL] R/O Enumerates GDS vulnerability
and mitigation support.
IA32_ARCH_CAPABILITIES[GDS_NO] R/O Processor is not vulnerable.
IA32_MCU_OPT_CTRL[GDS_MITG_DIS] R/W Disables the mitigation
0 by default.
IA32_MCU_OPT_CTRL[GDS_MITG_LOCK] R/W Locks GDS_MITG_DIS=0. Writes
to GDS_MITG_DIS are ignored
Can't be cleared once set.
================================ === ============================
GDS can also be mitigated on systems that don't have updated microcode by
disabling AVX. This can be done by setting gather_data_sampling="force" or
"clearcpuid=avx" on the kernel command-line.
If used, these options will disable AVX use by turning off XSAVE YMM support.
However, the processor will still enumerate AVX support. Userspace that
does not follow proper AVX enumeration to check both AVX *and* XSAVE YMM
support will break.
Mitigation control on the kernel command line
---------------------------------------------
The mitigation can be disabled by setting "gather_data_sampling=off" or
"mitigations=off" on the kernel command line. Not specifying either will default
to the mitigation being enabled. Specifying "gather_data_sampling=force" will
use the microcode mitigation when available or disable AVX on affected systems
where the microcode hasn't been updated to include the mitigation.
GDS System Information
------------------------
The kernel provides vulnerability status information through sysfs. For
GDS this can be accessed by the following sysfs file:
/sys/devices/system/cpu/vulnerabilities/gather_data_sampling
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: AVX disabled,
no microcode Processor is vulnerable and microcode is missing
mitigation. AVX disabled as mitigation.
Mitigation: Microcode Processor is vulnerable and mitigation is in
effect.
Mitigation: Microcode (locked) Processor is vulnerable and mitigation is in
effect and cannot be disabled.
Unknown: Dependent on
hypervisor status Running on a virtual guest processor that is
affected but with no way to know if host
processor is mitigated or vulnerable.
============================== =============================================
GDS Default mitigation
----------------------
The updated microcode will enable the mitigation by default. The kernel's
default action is to leave the mitigation enabled.
3. 한국어 전문 번역
영어 원문의 문단 순서와 의미를 유지한 전체 번역입니다. 코드, 함수명, symbol과 URL은 원문 표기를 유지합니다.
Gather Data Sampling 개요
1-8Gather Data Sampling(GDS)은 권한이 없는 코드가 이전에 vector register에 저장되었던 데이터에 speculative access할 수 있게 하는 hardware 취약점입니다.
문제의 동작 원리
9-26gather 명령이 memory에서 load를 수행하면 서로 다른 data element가 destination vector register에 합쳐집니다. 그러나 transient하게 실행된 gather 명령에서 fault가 발생하면 architectural 또는 internal vector register의 오래된 데이터가 destination vector register로 transient forwarding될 수 있습니다.
악의적인 공격자는 cache timing attack 같은 일반적인 side-channel 기법으로 이 오래된 데이터를 추론할 수 있습니다. GDS는 순수한 sampling 기반 공격입니다.
공격자는 gather 명령으로 오래된 vector register 데이터를 추론합니다. 피해자는 vector register를 사용하는 것 외에 특별한 동작을 할 필요가 없으며, 취약해지기 위해 gather 명령을 사용할 필요도 없습니다.
관련 buffer가 Hyper-Thread 사이에 공유되므로 교차 Hyper-Thread 공격도 가능합니다.
권한 경계를 넘는 공격 시나리오
27-45완화가 없으면 GDS는 사실상 모든 권한 경계를 넘어 오래된 데이터를 추론할 수 있습니다.
- non-enclave가 SGX enclave 데이터를 추론할 수 있습니다.
- userspace가 kernel 데이터를 추론할 수 있습니다.
- guest가 host 데이터를 추론할 수 있습니다.
- 한 guest가 다른 guest의 데이터를 추론할 수 있습니다.
- 한 user가 다른 user의 데이터를 추론할 수 있습니다.
따라서 guest 같은 낮은 권한의 context와 SGX enclave 바깥에서 실행할 때 완화가 계속 켜져 있는지 확인하는 것이 중요합니다.
hardware는 SGX에 대해 완화를 강제합니다. 마찬가지로 VMM은 guest가 GDS 완화를 끌 수 없게 해야 합니다. host가 이를 잘못 허용하면 guest가 이론적으로 GDS 완화를 끄고 공격한 뒤 다시 켤 수 있습니다.
microcode 완화와 AVX 비활성화
46-70이 문제는 microcode에서 완화됩니다. microcode는 다음 bit를 정의합니다.
| bit | 접근 | 의미 |
|---|---|---|
| IA32_ARCH_CAPABILITIES[GDS_CTRL] | R/O | GDS 취약점과 완화 지원을 열거합니다. |
| IA32_ARCH_CAPABILITIES[GDS_NO] | R/O | 프로세서가 취약하지 않음을 나타냅니다. |
| IA32_MCU_OPT_CTRL[GDS_MITG_DIS] | R/W | 완화를 끕니다. 기본값은 0입니다. |
| IA32_MCU_OPT_CTRL[GDS_MITG_LOCK] | R/W | GDS_MITG_DIS=0을 잠급니다. 이후 GDS_MITG_DIS write는 무시되며 한 번 설정하면 지울 수 없습니다. |
업데이트된 microcode가 없는 system에서도 AVX를 비활성화해 GDS를 완화할 수 있습니다. kernel command line에 `gather_data_sampling="force"` 또는 `clearcpuid=avx`를 설정합니다.
이 option은 XSAVE YMM 지원을 꺼서 AVX 사용을 막습니다. 다만 프로세서는 여전히 AVX 지원을 열거합니다. AVX와 XSAVE YMM 지원을 모두 확인하는 올바른 AVX 열거 절차를 따르지 않는 userspace는 오동작할 수 있습니다.
kernel command line 제어
71-78| 설정 | 동작 |
|---|---|
| gather_data_sampling=off | GDS 완화를 비활성화합니다. |
| mitigations=off | 전체 취약점 완화와 함께 끕니다. |
| option을 지정하지 않음 | GDS 완화를 기본으로 활성화합니다. |
| gather_data_sampling=force | 가능하면 microcode 완화를 사용하고, 완화 microcode가 없는 영향을 받는 system에서는 AVX를 비활성화합니다. |
GDS sysfs 상태 정보
79-105커널은 다음 sysfs file로 GDS 취약점 상태를 제공합니다.
/sys/devices/system/cpu/vulnerabilities/gather_data_sampling
| 상태 문자열 | 의미 |
|---|---|
| Not affected | 프로세서가 취약하지 않습니다. |
| Vulnerable | 프로세서가 취약하고 완화가 비활성화되어 있습니다. |
| Vulnerable: No microcode | 프로세서가 취약하며 완화 기능이 포함된 microcode가 없습니다. |
| Mitigation: AVX disabled, no microcode | 완화 microcode는 없지만 AVX를 비활성화해 완화했습니다. |
| Mitigation: Microcode | 프로세서가 취약하지만 microcode 완화가 적용 중입니다. |
| Mitigation: Microcode (locked) | microcode 완화가 적용 중이며 비활성화할 수 없습니다. |
| Unknown: Dependent on hypervisor status | 영향받는 virtual guest processor에서 실행 중이지만 host processor가 완화되었는지 취약한지 알 수 없습니다. |
기본 완화 상태
106-109업데이트된 microcode는 완화를 기본으로 활성화합니다. 커널의 기본 동작은 이 완화를 켜 둔 상태로 유지하는 것입니다.
GDS 문제와 공격 경계
gather_data_sampling.rst:1-45transient gather fault가 오래된 vector 데이터를 전달하는 원리와 권한 경계를 넘는 공격을 설명합니다.