요약·해설과 원문, 전문 번역을 서로 분리했습니다. API 이름, symbol, source path는 원문 표기를 사용합니다.
1. 요약·해설
원문의 핵심 논리와 kernel programming 관점의 보충 설명입니다. 아래의 전문 번역과는 별도로 작성했습니다.
thunk 기반 완화
indirect-target-selection.rst:55-109cacheline 두 번째 절반의 safe thunk, dynamic/static thunk, retpoline, RSB stuffing과 guest 합성 bit를 설명합니다.
option과 sysfs 보고
indirect-target-selection.rst:110-168`indirect_target_selection` option, sysfs 상태 문자열과 참고 자료를 제공합니다.
2. 영어 원문 전체
번역 기준이 된 Linux v6.18.37 원문입니다. 줄 번호는 이 버전의 파일 좌표입니다.
원문 전체 펼치기
.. SPDX-License-Identifier: GPL-2.0
Indirect Target Selection (ITS)
===============================
ITS is a vulnerability in some Intel CPUs that support Enhanced IBRS and were
released before Alder Lake. ITS may allow an attacker to control the prediction
of indirect branches and RETs located in the lower half of a cacheline.
ITS is assigned CVE-2024-28956 with a CVSS score of 4.7 (Medium).
Scope of Impact
---------------
- **eIBRS Guest/Host Isolation**: Indirect branches in KVM/kernel may still be
predicted with unintended target corresponding to a branch in the guest.
- **Intra-Mode BTI**: In-kernel training such as through cBPF or other native
gadgets.
- **Indirect Branch Prediction Barrier (IBPB)**: After an IBPB, indirect
branches may still be predicted with targets corresponding to direct branches
executed prior to the IBPB. This is fixed by the IPU 2025.1 microcode, which
should be available via distro updates. Alternatively microcode can be
obtained from Intel's github repository [#f1]_.
Affected CPUs
-------------
Below is the list of ITS affected CPUs [#f2]_ [#f3]_:
======================== ============ ==================== ===============
Common name Family_Model eIBRS Intra-mode BTI
Guest/Host Isolation
======================== ============ ==================== ===============
SKYLAKE_X (step >= 6) 06_55H Affected Affected
ICELAKE_X 06_6AH Not affected Affected
ICELAKE_D 06_6CH Not affected Affected
ICELAKE_L 06_7EH Not affected Affected
TIGERLAKE_L 06_8CH Not affected Affected
TIGERLAKE 06_8DH Not affected Affected
KABYLAKE_L (step >= 12) 06_8EH Affected Affected
KABYLAKE (step >= 13) 06_9EH Affected Affected
COMETLAKE 06_A5H Affected Affected
COMETLAKE_L 06_A6H Affected Affected
ROCKETLAKE 06_A7H Not affected Affected
======================== ============ ==================== ===============
- All affected CPUs enumerate Enhanced IBRS feature.
- IBPB isolation is affected on all ITS affected CPUs, and need a microcode
update for mitigation.
- None of the affected CPUs enumerate BHI_CTRL which was introduced in Golden
Cove (Alder Lake and Sapphire Rapids). This can help guests to determine the
host's affected status.
- Intel Atom CPUs are not affected by ITS.
Mitigation
----------
As only the indirect branches and RETs that have their last byte of instruction
in the lower half of the cacheline are vulnerable to ITS, the basic idea behind
the mitigation is to not allow indirect branches in the lower half.
This is achieved by relying on existing retpoline support in the kernel, and in
compilers. ITS-vulnerable retpoline sites are runtime patched to point to newly
added ITS-safe thunks. These safe thunks consists of indirect branch in the
second half of the cacheline. Not all retpoline sites are patched to thunks, if
a retpoline site is evaluated to be ITS-safe, it is replaced with an inline
indirect branch.
Dynamic thunks
~~~~~~~~~~~~~~
From a dynamically allocated pool of safe-thunks, each vulnerable site is
replaced with a new thunk, such that they get a unique address. This could
improve the branch prediction accuracy. Also, it is a defense-in-depth measure
against aliasing.
Note, for simplicity, indirect branches in eBPF programs are always replaced
with a jump to a static thunk in __x86_indirect_its_thunk_array. If required,
in future this can be changed to use dynamic thunks.
All vulnerable RETs are replaced with a static thunk, they do not use dynamic
thunks. This is because RETs get their prediction from RSB mostly that does not
depend on source address. RETs that underflow RSB may benefit from dynamic
thunks. But, RETs significantly outnumber indirect branches, and any benefit
from a unique source address could be outweighed by the increased icache
footprint and iTLB pressure.
Retpoline
~~~~~~~~~
Retpoline sequence also mitigates ITS-unsafe indirect branches. For this
reason, when retpoline is enabled, ITS mitigation only relocates the RETs to
safe thunks. Unless user requested the RSB-stuffing mitigation.
RSB Stuffing
~~~~~~~~~~~~
RSB-stuffing via Call Depth Tracking is a mitigation for Retbleed RSB-underflow
attacks. And it also mitigates RETs that are vulnerable to ITS.
Mitigation in guests
^^^^^^^^^^^^^^^^^^^^
All guests deploy ITS mitigation by default, irrespective of eIBRS enumeration
and Family/Model of the guest. This is because eIBRS feature could be hidden
from a guest. One exception to this is when a guest enumerates BHI_DIS_S, which
indicates that the guest is running on an unaffected host.
To prevent guests from unnecessarily deploying the mitigation on unaffected
platforms, Intel has defined ITS_NO bit(62) in MSR IA32_ARCH_CAPABILITIES. When
a guest sees this bit set, it should not enumerate the ITS bug. Note, this bit
is not set by any hardware, but is **intended for VMMs to synthesize** it for
guests as per the host's affected status.
Mitigation options
^^^^^^^^^^^^^^^^^^
The ITS mitigation can be controlled using the "indirect_target_selection"
kernel parameter. The available options are:
======== ===================================================================
on (default) Deploy the "Aligned branch/return thunks" mitigation.
If spectre_v2 mitigation enables retpoline, aligned-thunks are only
deployed for the affected RET instructions. Retpoline mitigates
indirect branches.
off Disable ITS mitigation.
vmexit Equivalent to "=on" if the CPU is affected by guest/host isolation
part of ITS. Otherwise, mitigation is not deployed. This option is
useful when host userspace is not in the threat model, and only
attacks from guest to host are considered.
stuff Deploy RSB-fill mitigation when retpoline is also deployed.
Otherwise, deploy the default mitigation. When retpoline mitigation
is enabled, RSB-stuffing via Call-Depth-Tracking also mitigates
ITS.
force Force the ITS bug and deploy the default mitigation.
======== ===================================================================
Sysfs reporting
---------------
The sysfs file showing ITS mitigation status is:
/sys/devices/system/cpu/vulnerabilities/indirect_target_selection
Note, microcode mitigation status is not reported in this file.
The possible values in this file are:
.. list-table::
* - Not affected
- The processor is not vulnerable.
* - Vulnerable
- System is vulnerable and no mitigation has been applied.
* - Vulnerable, KVM: Not affected
- System is vulnerable to intra-mode BTI, but not affected by eIBRS
guest/host isolation.
* - Mitigation: Aligned branch/return thunks
- The mitigation is enabled, affected indirect branches and RETs are
relocated to safe thunks.
* - Mitigation: Retpolines, Stuffing RSB
- The mitigation is enabled using retpoline and RSB stuffing.
References
----------
.. [#f1] Microcode repository - https://github.com/intel/Intel-Linux-Processor-Microcode-Data-Files
.. [#f2] Affected Processors list - https://www.intel.com/content/www/us/en/developer/topic-technology/software-security-guidance/processors-affected-consolidated-product-cpu-model.html
.. [#f3] Affected Processors list (machine readable) - https://github.com/intel/Intel-affected-processor-list
3. 한국어 전문 번역
영어 원문의 문단 순서와 의미를 유지한 전체 번역입니다. 코드, 함수명, symbol과 URL은 원문 표기를 유지합니다.
Indirect Target Selection 개요
1-11Indirect Target Selection(ITS)은 Enhanced IBRS를 지원하며 Alder Lake 이전에 출시된 일부 Intel CPU의 취약점입니다. 공격자는 cacheline 아래쪽 절반에 위치한 indirect branch와 `RET`의 예측을 제어할 수 있습니다.
ITS에는 `CVE-2024-28956`이 할당되었으며 CVSS 점수는 4.7(Medium)입니다.
영향 범위
12-25- **eIBRS Guest/Host Isolation**: KVM/kernel의 indirect branch가 guest의 branch에 대응하는 의도하지 않은 대상으로 여전히 예측될 수 있습니다.
- **Intra-Mode BTI**: cBPF 또는 다른 native gadget을 통한 in-kernel training이 가능합니다.
- **Indirect Branch Prediction Barrier (IBPB)**: IBPB 뒤에도 indirect branch가 IBPB 이전에 실행된 direct branch에 대응하는 대상으로 예측될 수 있습니다. 이 문제는 IPU 2025.1 microcode에서 수정되며 distribution update 또는 Intel microcode repository `[#f1]_`에서 받을 수 있습니다.
영향받는 CPU
26-54다음 CPU가 ITS의 영향을 받습니다 `[#f2]_` `[#f3]_`.
| Common name | Family_Model | eIBRS Guest/Host Isolation | Intra-mode BTI |
|---|---|---|---|
| SKYLAKE_X (step >= 6) | 06_55H | Affected | Affected |
| ICELAKE_X | 06_6AH | Not affected | Affected |
| ICELAKE_D | 06_6CH | Not affected | Affected |
| ICELAKE_L | 06_7EH | Not affected | Affected |
| TIGERLAKE_L | 06_8CH | Not affected | Affected |
| TIGERLAKE | 06_8DH | Not affected | Affected |
| KABYLAKE_L (step >= 12) | 06_8EH | Affected | Affected |
| KABYLAKE (step >= 13) | 06_9EH | Affected | Affected |
| COMETLAKE | 06_A5H | Affected | Affected |
| COMETLAKE_L | 06_A6H | Affected | Affected |
| ROCKETLAKE | 06_A7H | Not affected | Affected |
- 영향받는 모든 CPU는 Enhanced IBRS feature를 열거합니다.
- ITS의 영향을 받는 모든 CPU에서 IBPB isolation도 영향을 받으므로 완화하려면 microcode update가 필요합니다.
- 영향받는 CPU 중 Golden Cove(Alder Lake 및 Sapphire Rapids)에서 도입된 `BHI_CTRL`을 열거하는 CPU는 없습니다. guest는 이를 이용해 host의 영향 여부를 판단할 수 있습니다.
- Intel Atom CPU는 ITS의 영향을 받지 않습니다.
cacheline 배치를 이용한 완화
55-67명령의 마지막 byte가 cacheline 아래쪽 절반에 놓인 indirect branch와 `RET`만 ITS에 취약합니다. 따라서 완화의 기본 원리는 indirect branch가 아래쪽 절반에 놓이지 않게 하는 것입니다.
커널과 compiler의 기존 retpoline 지원을 이용해 이를 구현합니다. ITS에 취약한 retpoline site는 runtime에 새 ITS-safe thunk를 가리키도록 patch됩니다. safe thunk의 indirect branch는 cacheline의 두 번째 절반에 놓입니다. 모든 retpoline site를 thunk로 바꾸지는 않으며, ITS-safe로 판정된 site는 inline indirect branch로 교체합니다.
Dynamic thunk
68-85동적으로 할당된 safe-thunk pool에서 각 취약 site를 고유 주소의 새 thunk로 교체합니다. 이는 branch prediction 정확도를 높일 수 있고 aliasing에 대한 defense-in-depth 수단도 됩니다.
단순화를 위해 eBPF program의 indirect branch는 항상 `__x86_indirect_its_thunk_array`의 static thunk로 jump하도록 교체합니다. 필요하다면 나중에 dynamic thunk를 사용하도록 바꿀 수 있습니다.
취약한 모든 `RET`는 static thunk로 교체하며 dynamic thunk를 사용하지 않습니다. `RET`는 대부분 source address에 의존하지 않는 RSB에서 예측을 얻기 때문입니다. RSB underflow가 발생하는 `RET`는 dynamic thunk의 이점을 얻을 수 있지만, `RET` 수가 indirect branch보다 훨씬 많으므로 고유 source address의 이점보다 icache footprint와 iTLB pressure 증가 비용이 더 클 수 있습니다.
Retpoline과 RSB stuffing
86-96retpoline sequence도 ITS-unsafe indirect branch를 완화합니다. 그래서 retpoline이 활성화된 경우 ITS 완화는 사용자가 RSB-stuffing 완화를 요청하지 않는 한 `RET`만 safe thunk로 재배치합니다.
Call Depth Tracking을 통한 RSB stuffing은 Retbleed RSB-underflow 공격의 완화이며, ITS에 취약한 `RET`도 함께 완화합니다.
guest에서의 완화
97-109모든 guest는 eIBRS 열거 여부와 guest의 Family/Model에 관계없이 ITS 완화를 기본으로 적용합니다. eIBRS feature가 guest에서 숨겨질 수 있기 때문입니다. 예외는 guest가 `BHI_DIS_S`를 열거하는 경우이며, 이는 영향받지 않는 host에서 실행 중임을 나타냅니다.
영향받지 않는 platform의 guest가 불필요하게 완화를 적용하지 않도록 Intel은 `MSR IA32_ARCH_CAPABILITIES`에 `ITS_NO` bit(62)를 정의했습니다. 이 bit를 본 guest는 ITS bug를 열거하지 않아야 합니다. 어떤 hardware도 이 bit를 직접 설정하지 않으며, host의 영향 상태에 따라 VMM이 guest용으로 합성하도록 의도된 bit입니다.
indirect_target_selection option
110-135ITS 완화는 `indirect_target_selection` kernel parameter로 제어합니다.
| option | 동작 |
|---|---|
| on | 기본값입니다. `Aligned branch/return thunks` 완화를 적용합니다. `spectre_v2` 완화가 retpoline을 켰다면 aligned thunk는 영향을 받는 RET에만 적용되고 indirect branch는 retpoline이 완화합니다. |
| off | ITS 완화를 비활성화합니다. |
| vmexit | CPU가 ITS의 guest/host isolation 부분에 영향을 받으면 `on`과 동일하며, 아니면 완화를 적용하지 않습니다. host userspace가 threat model에 없고 guest-to-host 공격만 고려할 때 유용합니다. |
| stuff | retpoline도 적용된 경우 RSB-fill 완화를 배치하고, 아니면 기본 완화를 배치합니다. retpoline이 활성화되면 Call-Depth-Tracking을 통한 RSB stuffing도 ITS를 완화합니다. |
| force | ITS bug를 강제로 표시하고 기본 완화를 적용합니다. |
ITS sysfs 보고
136-161ITS 완화 상태는 다음 sysfs file에서 확인합니다.
/sys/devices/system/cpu/vulnerabilities/indirect_target_selection
이 file은 microcode 완화 상태를 보고하지 않습니다.
| 상태 문자열 | 의미 |
|---|---|
| Not affected | 프로세서가 취약하지 않습니다. |
| Vulnerable | system이 취약하며 적용된 완화가 없습니다. |
| Vulnerable, KVM: Not affected | system은 intra-mode BTI에는 취약하지만 eIBRS guest/host isolation의 영향은 받지 않습니다. |
| Mitigation: Aligned branch/return thunks | 완화가 켜졌으며 영향을 받는 indirect branch와 RET가 safe thunk로 재배치되었습니다. |
| Mitigation: Retpolines, Stuffing RSB | retpoline과 RSB stuffing을 사용하는 완화가 켜졌습니다. |
참고 자료
162-168| 표시 | 자료 |
|---|---|
| [#f1] | Microcode repository - https://github.com/intel/Intel-Linux-Processor-Microcode-Data-Files |
| [#f2] | Affected Processors list - https://www.intel.com/content/www/us/en/developer/topic-technology/software-security-guidance/processors-affected-consolidated-product-cpu-model.html |
| [#f3] | Affected Processors list (machine readable) - https://github.com/intel/Intel-affected-processor-list |
영향 범위와 CPU
indirect-target-selection.rst:1-54eIBRS guest/host isolation, intra-mode BTI, IBPB 영향과 Family_Model별 상태를 정리합니다.