요약·해설과 원문, 전문 번역을 서로 분리했습니다. API 이름, symbol, source path는 원문 표기를 사용합니다.
1. 요약·해설
원문의 핵심 논리와 kernel programming 관점의 보충 설명입니다. 아래의 전문 번역과는 별도로 작성했습니다.
2. 영어 원문 전체
번역 기준이 된 Linux v6.18.37 원문입니다. 줄 번호는 이 버전의 파일 좌표입니다.
원문 전체 펼치기
.. SPDX-License-Identifier: GPL-2.0
TSX Async Abort (TAA) mitigation
================================
.. _tsx_async_abort:
Overview
--------
TSX Async Abort (TAA) is a side channel attack on internal buffers in some
Intel processors similar to Microachitectural Data Sampling (MDS). In this
case certain loads may speculatively pass invalid data to dependent operations
when an asynchronous abort condition is pending in a Transactional
Synchronization Extensions (TSX) transaction. This includes loads with no
fault or assist condition. Such loads may speculatively expose stale data from
the same uarch data structures as in MDS, with same scope of exposure i.e.
same-thread and cross-thread. This issue affects all current processors that
support TSX.
Mitigation strategy
-------------------
a) TSX disable - one of the mitigations is to disable TSX. A new MSR
IA32_TSX_CTRL will be available in future and current processors after
microcode update which can be used to disable TSX. In addition, it
controls the enumeration of the TSX feature bits (RTM and HLE) in CPUID.
b) Clear CPU buffers - similar to MDS, clearing the CPU buffers mitigates this
vulnerability. More details on this approach can be found in
:ref:`Documentation/admin-guide/hw-vuln/mds.rst <mds>`.
Kernel internal mitigation modes
--------------------------------
============= ============================================================
off Mitigation is disabled. Either the CPU is not affected or
tsx_async_abort=off is supplied on the kernel command line.
tsx disabled Mitigation is enabled. TSX feature is disabled by default at
bootup on processors that support TSX control.
verw Mitigation is enabled. CPU is affected and MD_CLEAR is
advertised in CPUID.
ucode needed Mitigation is enabled. CPU is affected and MD_CLEAR is not
advertised in CPUID. That is mainly for virtualization
scenarios where the host has the updated microcode but the
hypervisor does not expose MD_CLEAR in CPUID. It's a best
effort approach without guarantee.
============= ============================================================
If the CPU is affected and the "tsx_async_abort" kernel command line parameter is
not provided then the kernel selects an appropriate mitigation depending on the
status of RTM and MD_CLEAR CPUID bits.
Below tables indicate the impact of tsx=on|off|auto cmdline options on state of
TAA mitigation, VERW behavior and TSX feature for various combinations of
MSR_IA32_ARCH_CAPABILITIES bits.
1. "tsx=off"
========= ========= ============ ============ ============== =================== ======================
MSR_IA32_ARCH_CAPABILITIES bits Result with cmdline tsx=off
---------------------------------- -------------------------------------------------------------------------
TAA_NO MDS_NO TSX_CTRL_MSR TSX state VERW can clear TAA mitigation TAA mitigation
after bootup CPU buffers tsx_async_abort=off tsx_async_abort=full
========= ========= ============ ============ ============== =================== ======================
0 0 0 HW default Yes Same as MDS Same as MDS
0 0 1 Invalid case Invalid case Invalid case Invalid case
0 1 0 HW default No Need ucode update Need ucode update
0 1 1 Disabled Yes TSX disabled TSX disabled
1 X 1 Disabled X None needed None needed
========= ========= ============ ============ ============== =================== ======================
2. "tsx=on"
========= ========= ============ ============ ============== =================== ======================
MSR_IA32_ARCH_CAPABILITIES bits Result with cmdline tsx=on
---------------------------------- -------------------------------------------------------------------------
TAA_NO MDS_NO TSX_CTRL_MSR TSX state VERW can clear TAA mitigation TAA mitigation
after bootup CPU buffers tsx_async_abort=off tsx_async_abort=full
========= ========= ============ ============ ============== =================== ======================
0 0 0 HW default Yes Same as MDS Same as MDS
0 0 1 Invalid case Invalid case Invalid case Invalid case
0 1 0 HW default No Need ucode update Need ucode update
0 1 1 Enabled Yes None Same as MDS
1 X 1 Enabled X None needed None needed
========= ========= ============ ============ ============== =================== ======================
3. "tsx=auto"
========= ========= ============ ============ ============== =================== ======================
MSR_IA32_ARCH_CAPABILITIES bits Result with cmdline tsx=auto
---------------------------------- -------------------------------------------------------------------------
TAA_NO MDS_NO TSX_CTRL_MSR TSX state VERW can clear TAA mitigation TAA mitigation
after bootup CPU buffers tsx_async_abort=off tsx_async_abort=full
========= ========= ============ ============ ============== =================== ======================
0 0 0 HW default Yes Same as MDS Same as MDS
0 0 1 Invalid case Invalid case Invalid case Invalid case
0 1 0 HW default No Need ucode update Need ucode update
0 1 1 Disabled Yes TSX disabled TSX disabled
1 X 1 Enabled X None needed None needed
========= ========= ============ ============ ============== =================== ======================
In the tables, TSX_CTRL_MSR is a new bit in MSR_IA32_ARCH_CAPABILITIES that
indicates whether MSR_IA32_TSX_CTRL is supported.
There are two control bits in IA32_TSX_CTRL MSR:
Bit 0: When set it disables the Restricted Transactional Memory (RTM)
sub-feature of TSX (will force all transactions to abort on the
XBEGIN instruction).
Bit 1: When set it disables the enumeration of the RTM and HLE feature
(i.e. it will make CPUID(EAX=7).EBX{bit4} and
CPUID(EAX=7).EBX{bit11} read as 0).
3. 한국어 전문 번역
영어 원문의 문단 순서와 의미를 유지한 전체 번역입니다. 코드, 함수명, symbol과 URL은 원문 표기를 유지합니다.
TSX Async Abort 개요
1-20이 문서는 `SPDX-License-Identifier: GPL-2.0`으로 배포됩니다. TSX Async Abort(TAA)는 일부 Intel processor의 internal buffer를 노리는 side-channel attack이며 Microarchitectural Data Sampling (MDS)과 유사합니다.
Transactional Synchronization Extensions(TSX) transaction에 asynchronous abort condition이 pending 상태일 때 일부 load가 invalid data를 dependent operation에 speculative하게 전달할 수 있습니다. fault나 assist condition이 없는 load도 여기에 포함됩니다.
이런 load는 MDS와 같은 microarchitecture data structure에 남은 stale data를 speculative하게 노출할 수 있으며 exposure scope도 same-thread와 cross-thread로 같습니다. 이 문제는 TSX를 지원하는 현재의 모든 processor에 영향을 줍니다.
TAA 완화 전략
21-32TAA에는 다음 두 가지 mitigation strategy가 있습니다.
- `TSX disable`: 향후 processor와 microcode update를 적용한 현재 processor에서 제공되는 새 `IA32_TSX_CTRL` MSR로 TSX를 비활성화합니다. 이 MSR은 CPUID의 TSX feature bit인 RTM과 HLE enumeration도 제어합니다.
- `Clear CPU buffers`: MDS와 마찬가지로 CPU buffer를 비우면 이 취약점을 완화합니다. 자세한 내용은 `Documentation/admin-guide/hw-vuln/mds.rst`의 `mds` reference를 참고하십시오.
kernel 내부 mitigation mode
33-60| mode | 상태와 선택 조건 |
|---|---|
| `off` | mitigation이 비활성화되어 있습니다. CPU가 영향을 받지 않거나 kernel command line에 `tsx_async_abort=off`를 지정한 경우입니다. |
| `tsx disabled` | mitigation이 활성화되어 있습니다. TSX control을 지원하는 processor에서 boot 시 기본적으로 TSX feature를 비활성화합니다. |
| `verw` | mitigation이 활성화되어 있습니다. CPU가 영향을 받고 CPUID가 `MD_CLEAR`를 광고합니다. |
| `ucode needed` | mitigation이 활성화되어 있습니다. CPU가 영향을 받지만 CPUID가 `MD_CLEAR`를 광고하지 않습니다. 주로 host에는 updated microcode가 있지만 hypervisor가 CPUID에 `MD_CLEAR`를 노출하지 않는 virtualization scenario를 위한 best-effort 방식이며 보장은 없습니다. |
CPU가 영향을 받고 `tsx_async_abort` kernel command-line parameter가 없으면 kernel은 RTM과 `MD_CLEAR` CPUID bit 상태에 따라 적절한 mitigation을 선택합니다.
아래 표는 `MSR_IA32_ARCH_CAPABILITIES` bit 조합별로 `tsx=on|off|auto` command-line option이 TAA mitigation 상태, `VERW` 동작, TSX feature에 미치는 영향을 보여 줍니다.
tsx=off 조합표
61-75| `TAA_NO` | `MDS_NO` | `TSX_CTRL_MSR` | boot 후 TSX 상태 | `VERW`의 CPU buffer clear | `tsx_async_abort=off` | `tsx_async_abort=full` |
|---|---|---|---|---|---|---|
| 0 | 0 | 0 | `HW default` | 가능 | MDS와 동일 | MDS와 동일 |
| 0 | 0 | 1 | `Invalid case` | `Invalid case` | `Invalid case` | `Invalid case` |
| 0 | 1 | 0 | `HW default` | 불가능 | `Need ucode update` | `Need ucode update` |
| 0 | 1 | 1 | `Disabled` | 가능 | `TSX disabled` | `TSX disabled` |
| 1 | X | 1 | `Disabled` | X | `None needed` | `None needed` |
tsx=on 조합표
76-90| `TAA_NO` | `MDS_NO` | `TSX_CTRL_MSR` | boot 후 TSX 상태 | `VERW`의 CPU buffer clear | `tsx_async_abort=off` | `tsx_async_abort=full` |
|---|---|---|---|---|---|---|
| 0 | 0 | 0 | `HW default` | 가능 | MDS와 동일 | MDS와 동일 |
| 0 | 0 | 1 | `Invalid case` | `Invalid case` | `Invalid case` | `Invalid case` |
| 0 | 1 | 0 | `HW default` | 불가능 | `Need ucode update` | `Need ucode update` |
| 0 | 1 | 1 | `Enabled` | 가능 | `None` | MDS와 동일 |
| 1 | X | 1 | `Enabled` | X | `None needed` | `None needed` |
tsx=auto 조합표
91-105| `TAA_NO` | `MDS_NO` | `TSX_CTRL_MSR` | boot 후 TSX 상태 | `VERW`의 CPU buffer clear | `tsx_async_abort=off` | `tsx_async_abort=full` |
|---|---|---|---|---|---|---|
| 0 | 0 | 0 | `HW default` | 가능 | MDS와 동일 | MDS와 동일 |
| 0 | 0 | 1 | `Invalid case` | `Invalid case` | `Invalid case` | `Invalid case` |
| 0 | 1 | 0 | `HW default` | 불가능 | `Need ucode update` | `Need ucode update` |
| 0 | 1 | 1 | `Disabled` | 가능 | `TSX disabled` | `TSX disabled` |
| 1 | X | 1 | `Enabled` | X | `None needed` | `None needed` |
IA32_TSX_CTRL control bit
106-117표의 `TSX_CTRL_MSR`은 `MSR_IA32_ARCH_CAPABILITIES`의 새 bit이며 `MSR_IA32_TSX_CTRL` 지원 여부를 나타냅니다.
`IA32_TSX_CTRL` MSR에는 두 control bit가 있습니다.
| bit | 동작 |
|---|---|
| Bit 0 | 설정하면 TSX의 Restricted Transactional Memory(RTM) sub-feature를 비활성화하며 모든 transaction이 `XBEGIN` instruction에서 abort하도록 강제합니다. |
| Bit 1 | 설정하면 RTM과 HLE feature enumeration을 비활성화해 `CPUID(EAX=7).EBX{bit4}`와 `CPUID(EAX=7).EBX{bit11}`이 0으로 읽히게 합니다. |
요약과 해설
tsx_async_abort.rst:1-117TAA는 TSX transaction의 asynchronous abort 중 internal buffer의 stale data가 speculative하게 노출되는 MDS 계열 공격입니다. kernel은 TSX를 끄거나 `VERW`로 CPU buffer를 지우며 RTM, `MD_CLEAR`, architecture capability bit에 따라 mode를 선택합니다.
`tsx=off|on|auto`와 `tsx_async_abort=off|full`의 결과는 `TAA_NO`, `MDS_NO`, `TSX_CTRL_MSR` 조합에 따라 달라집니다. `IA32_TSX_CTRL`은 RTM 실행과 RTM/HLE CPUID enumeration을 각각 제어합니다.