요약·해설과 원문, 전문 번역을 서로 분리했습니다. API 이름, symbol, source path는 원문 표기를 사용합니다.
1. 요약·해설
원문의 핵심 논리와 kernel programming 관점의 보충 설명입니다. 아래의 전문 번역과는 별도로 작성했습니다.
Command line과 취약점 표
attack_vector_controls.rst:129-236`mitigations=` global 및 비활성화 option, 취약점별 option 우선순위와 18개 취약점의 attack vector matrix를 제공합니다.
2. 영어 원문 전체
번역 기준이 된 Linux v6.18.37 원문입니다. 줄 번호는 이 버전의 파일 좌표입니다.
원문 전체 펼치기
.. SPDX-License-Identifier: GPL-2.0
Attack Vector Controls
======================
Attack vector controls provide a simple method to configure only the mitigations
for CPU vulnerabilities which are relevant given the intended use of a system.
Administrators are encouraged to consider which attack vectors are relevant and
disable all others in order to recoup system performance.
When new relevant CPU vulnerabilities are found, they will be added to these
attack vector controls so administrators will likely not need to reconfigure
their command line parameters as mitigations will continue to be correctly
applied based on the chosen attack vector controls.
Attack Vectors
--------------
There are 5 sets of attack-vector mitigations currently supported by the kernel:
#. :ref:`user_kernel`
#. :ref:`user_user`
#. :ref:`guest_host`
#. :ref:`guest_guest`
#. :ref:`smt`
To control the enabled attack vectors, see :ref:`cmdline`.
.. _user_kernel:
User-to-Kernel
^^^^^^^^^^^^^^
The user-to-kernel attack vector involves a malicious userspace program
attempting to leak kernel data into userspace by exploiting a CPU vulnerability.
The kernel data involved might be limited to certain kernel memory, or include
all memory in the system, depending on the vulnerability exploited.
If no untrusted userspace applications are being run, such as with single-user
systems, consider disabling user-to-kernel mitigations.
Note that the CPU vulnerabilities mitigated by Linux have generally not been
shown to be exploitable from browser-based sandboxes. User-to-kernel
mitigations are therefore mostly relevant if unknown userspace applications may
be run by untrusted users.
*user-to-kernel mitigations are enabled by default*
.. _user_user:
User-to-User
^^^^^^^^^^^^
The user-to-user attack vector involves a malicious userspace program attempting
to influence the behavior of another unsuspecting userspace program in order to
exfiltrate data. The vulnerability of a userspace program is based on the
program itself and the interfaces it provides.
If no untrusted userspace applications are being run, consider disabling
user-to-user mitigations.
Note that because the Linux kernel contains a mapping of all physical memory,
preventing a malicious userspace program from leaking data from another
userspace program requires mitigating user-to-kernel attacks as well for
complete protection.
*user-to-user mitigations are enabled by default*
.. _guest_host:
Guest-to-Host
^^^^^^^^^^^^^
The guest-to-host attack vector involves a malicious VM attempting to leak
hypervisor data into the VM. The data involved may be limited, or may
potentially include all memory in the system, depending on the vulnerability
exploited.
If no untrusted VMs are being run, consider disabling guest-to-host mitigations.
*guest-to-host mitigations are enabled by default if KVM support is present*
.. _guest_guest:
Guest-to-Guest
^^^^^^^^^^^^^^
The guest-to-guest attack vector involves a malicious VM attempting to influence
the behavior of another unsuspecting VM in order to exfiltrate data. The
vulnerability of a VM is based on the code inside the VM itself and the
interfaces it provides.
If no untrusted VMs, or only a single VM is being run, consider disabling
guest-to-guest mitigations.
Similar to the user-to-user attack vector, preventing a malicious VM from
leaking data from another VM requires mitigating guest-to-host attacks as well
due to the Linux kernel phys map.
*guest-to-guest mitigations are enabled by default if KVM support is present*
.. _smt:
Cross-Thread
^^^^^^^^^^^^
The cross-thread attack vector involves a malicious userspace program or
malicious VM either observing or attempting to influence the behavior of code
running on the SMT sibling thread in order to exfiltrate data.
Many cross-thread attacks can only be mitigated if SMT is disabled, which will
result in reduced CPU core count and reduced performance.
If cross-thread mitigations are fully enabled ('auto,nosmt'), all mitigations
for cross-thread attacks will be enabled. SMT may be disabled depending on
which vulnerabilities are present in the CPU.
If cross-thread mitigations are partially enabled ('auto'), mitigations for
cross-thread attacks will be enabled but SMT will not be disabled.
If cross-thread mitigations are disabled, no mitigations for cross-thread
attacks will be enabled.
Cross-thread mitigation may not be required if core-scheduling or similar
techniques are used to prevent untrusted workloads from running on SMT siblings.
*cross-thread mitigations default to partially enabled*
.. _cmdline:
Command Line Controls
---------------------
Attack vectors are controlled through the mitigations= command line option. The
value provided begins with a global option and then may optionally include one
or more options to disable various attack vectors.
Format:
| ``mitigations=[global]``
| ``mitigations=[global],[attack vectors]``
Global options:
============ =============================================================
Option Description
============ =============================================================
'off' All attack vectors disabled.
'auto' All attack vectors enabled, partial cross-thread mitigations.
'auto,nosmt' All attack vectors enabled, full cross-thread mitigations.
============ =============================================================
Attack vector options:
================= =======================================
Option Description
================= =======================================
'no_user_kernel' Disables user-to-kernel mitigations.
'no_user_user' Disables user-to-user mitigations.
'no_guest_host' Disables guest-to-host mitigations.
'no_guest_guest' Disables guest-to-guest mitigations
'no_cross_thread' Disables all cross-thread mitigations.
================= =======================================
Multiple attack vector options may be specified in a comma-separated list. If
the global option is not specified, it defaults to 'auto'. The global option
'off' is equivalent to disabling all attack vectors.
Examples:
| ``mitigations=auto,no_user_kernel``
Enable all attack vectors except user-to-kernel. Partial cross-thread
mitigations.
| ``mitigations=auto,nosmt,no_guest_host,no_guest_guest``
Enable all attack vectors and cross-thread mitigations except for
guest-to-host and guest-to-guest mitigations.
| ``mitigations=,no_cross_thread``
Enable all attack vectors but not cross-thread mitigations.
Interactions with command-line options
--------------------------------------
Vulnerability-specific controls (e.g. "retbleed=off") take precedence over all
attack vector controls. Mitigations for individual vulnerabilities may be
turned on or off via their command-line options regardless of the attack vector
controls.
Summary of attack-vector mitigations
------------------------------------
When a vulnerability is mitigated due to an attack-vector control, the default
mitigation option for that particular vulnerability is used. To use a different
mitigation, please use the vulnerability-specific command line option.
The table below summarizes which vulnerabilities are mitigated when different
attack vectors are enabled and assuming the CPU is vulnerable.
=============== ============== ============ ============= ============== ============ ========
Vulnerability User-to-Kernel User-to-User Guest-to-Host Guest-to-Guest Cross-Thread Notes
=============== ============== ============ ============= ============== ============ ========
BHI X X
ITS X X
GDS X X X X * (Note 1)
L1TF X X * (Note 2)
MDS X X X X * (Note 2)
MMIO X X X X * (Note 2)
Meltdown X
Retbleed X X * (Note 3)
RFDS X X X X
Spectre_v1 X
Spectre_v2 X X
Spectre_v2_user X X * (Note 1)
SRBDS X X X X
SRSO X X X X
SSB X
TAA X X X X * (Note 2)
TSA X X X X
VMSCAPE X
=============== ============== ============ ============= ============== ============ ========
Notes:
1 -- Can be mitigated without disabling SMT.
2 -- Disables SMT if cross-thread mitigations are fully enabled and the CPU
is vulnerable
3 -- Disables SMT if cross-thread mitigations are fully enabled, the CPU is
vulnerable, and STIBP is not supported
When an attack-vector is disabled, all mitigations for the vulnerabilities
listed in the above table are disabled, unless mitigation is required for a
different enabled attack-vector or a mitigation is explicitly selected via a
vulnerability-specific command line option.
3. 한국어 전문 번역
영어 원문의 문단 순서와 의미를 유지한 전체 번역입니다. 코드, 함수명, symbol과 URL은 원문 표기를 유지합니다.
Attack Vector Controls 개요
1-15Attack vector control은 시스템의 예정된 용도와 관련된 CPU 취약점 완화만 구성하는 단순한 방법입니다. 관리자는 어떤 공격 벡터가 실제로 관련되는지 판단하고 나머지를 꺼서 시스템 성능을 회복하는 것이 권장됩니다.
새로운 관련 CPU 취약점이 발견되면 이 attack vector control에 추가됩니다. 따라서 선택한 공격 벡터를 기준으로 새 완화도 계속 올바르게 적용되며 관리자가 command line parameter를 다시 구성할 필요가 줄어듭니다.
지원하는 공격 벡터
16-28커널은 현재 다섯 가지 attack-vector mitigation 집합을 지원합니다.
- User-to-Kernel
- User-to-User
- Guest-to-Host
- Guest-to-Guest
- Cross-Thread(SMT)
활성화할 공격 벡터는 아래 `mitigations=` command line control로 지정합니다.
User-to-Kernel
29-48user-to-kernel 공격 벡터는 악성 사용자 공간 프로그램이 CPU 취약점을 악용해 커널 데이터를 사용자 공간으로 유출하려는 경우입니다. 취약점에 따라 특정 커널 메모리만 대상일 수도 있고 시스템 전체 메모리를 포함할 수도 있습니다.
단일 사용자 시스템처럼 신뢰하지 않는 사용자 공간 애플리케이션을 실행하지 않는다면 이 완화를 끄는 방안을 고려할 수 있습니다.
Linux가 완화하는 CPU 취약점은 일반적으로 browser sandbox에서 악용 가능하다고 입증되지 않았습니다. 따라서 알 수 없는 사용자 공간 애플리케이션을 신뢰하지 않는 사용자가 실행할 수 있을 때 주로 중요합니다.
user-to-kernel 완화는 기본으로 활성화됩니다.
User-to-User
49-68user-to-user 공격 벡터는 악성 사용자 공간 프로그램이 다른 사용자 공간 프로그램의 동작에 영향을 주어 데이터를 빼내려는 경우입니다. 프로그램의 취약성은 프로그램 자체와 제공하는 interface에 달려 있습니다.
신뢰하지 않는 사용자 공간 애플리케이션을 실행하지 않는다면 이 완화를 끄는 방안을 고려할 수 있습니다.
Linux 커널에는 전체 물리 메모리 mapping이 있으므로 악성 프로그램이 다른 프로그램의 데이터를 유출하지 못하게 완전히 보호하려면 user-to-kernel 공격도 함께 완화해야 합니다.
user-to-user 완화는 기본으로 활성화됩니다.
Guest-to-Host
69-82guest-to-host 공격 벡터는 악성 VM이 hypervisor 데이터를 VM 안으로 유출하려는 경우입니다. 취약점에 따라 제한된 데이터만 대상일 수도 있고 시스템 전체 메모리를 포함할 수도 있습니다.
신뢰하지 않는 VM을 실행하지 않는다면 guest-to-host 완화를 끄는 방안을 고려할 수 있습니다.
KVM 지원이 있으면 guest-to-host 완화는 기본으로 활성화됩니다.
Guest-to-Guest
83-101guest-to-guest 공격 벡터는 악성 VM이 다른 VM의 동작에 영향을 주어 데이터를 빼내려는 경우입니다. VM의 취약성은 VM 내부 코드와 제공하는 interface에 달려 있습니다.
신뢰하지 않는 VM이 없거나 VM 하나만 실행한다면 이 완화를 끄는 방안을 고려할 수 있습니다.
user-to-user와 마찬가지로 Linux kernel physical map 때문에 악성 VM이 다른 VM의 데이터를 유출하지 못하게 완전히 보호하려면 guest-to-host 공격도 함께 완화해야 합니다.
KVM 지원이 있으면 guest-to-guest 완화는 기본으로 활성화됩니다.
Cross-Thread
102-128cross-thread 공격 벡터는 악성 사용자 공간 프로그램 또는 VM이 같은 core의 SMT sibling thread에서 실행 중인 코드를 관찰하거나 동작에 영향을 주어 데이터를 빼내는 경우입니다.
많은 cross-thread 공격은 SMT를 꺼야만 완전히 완화할 수 있으며, 이 경우 CPU core 수와 성능이 줄어듭니다.
| 설정 | 동작 |
|---|---|
| auto,nosmt | cross-thread 공격 완화를 모두 켭니다. CPU에 존재하는 취약점에 따라 SMT도 꺼질 수 있습니다. |
| auto | cross-thread 완화를 켜지만 SMT는 끄지 않습니다. |
| disabled | cross-thread 공격 완화를 모두 끕니다. |
core scheduling 같은 기법으로 신뢰하지 않는 workload가 SMT sibling에서 함께 실행되지 않게 한다면 cross-thread 완화가 필요하지 않을 수도 있습니다.
cross-thread 완화의 기본값은 부분 활성화입니다.
mitigations= command line 제어
129-182공격 벡터는 `mitigations=` command line option으로 제어합니다. 값은 global option으로 시작하고, 선택적으로 여러 attack vector 비활성화 option이 이어집니다.
mitigations=[global]
mitigations=[global],[attack vectors]
| global option | 설명 |
|---|---|
| off | 모든 공격 벡터를 끕니다. |
| auto | 모든 공격 벡터를 켜고 cross-thread 완화는 부분 활성화합니다. |
| auto,nosmt | 모든 공격 벡터와 완전한 cross-thread 완화를 켭니다. |
| attack vector option | 설명 |
|---|---|
| no_user_kernel | user-to-kernel 완화를 끕니다. |
| no_user_user | user-to-user 완화를 끕니다. |
| no_guest_host | guest-to-host 완화를 끕니다. |
| no_guest_guest | guest-to-guest 완화를 끕니다. |
| no_cross_thread | 모든 cross-thread 완화를 끕니다. |
attack vector option은 쉼표 목록으로 여러 개 지정할 수 있습니다. global option을 생략하면 `auto`가 기본값입니다. `off`는 모든 공격 벡터를 끄는 것과 같습니다.
mitigations=auto,no_user_kernel
mitigations=auto,nosmt,no_guest_host,no_guest_guest
mitigations=,no_cross_thread
- `mitigations=auto,no_user_kernel`은 user-to-kernel을 제외한 모든 벡터를 켜고 cross-thread는 부분 완화합니다.
- `mitigations=auto,nosmt,no_guest_host,no_guest_guest`는 guest-to-host와 guest-to-guest를 제외한 모든 벡터와 완전한 cross-thread 완화를 켭니다.
- `mitigations=,no_cross_thread`는 cross-thread를 제외한 모든 벡터를 켭니다. 비어 있는 global 위치는 기본값 `auto`를 사용합니다.
취약점별 option과의 상호작용
183-200`retbleed=off` 같은 취약점별 control이 모든 attack vector control보다 우선합니다. 개별 취약점 완화는 attack vector 설정과 관계없이 해당 command line option으로 켜거나 끌 수 있습니다.
attack vector control 때문에 취약점을 완화할 때는 그 취약점의 기본 mitigation option을 사용합니다. 다른 완화를 쓰려면 취약점별 command line option을 지정해야 합니다.
아래 표는 CPU가 취약하다고 가정할 때 각 attack vector가 활성화되면 어떤 취약점을 완화하는지 요약합니다.
공격 벡터별 취약점 완화표
201-236X는 해당 attack vector가 취약점 완화를 활성화함을 뜻하고, *는 cross-thread 조건부 완화를 뜻합니다.
attack vector를 끄면 위 표의 해당 취약점 완화가 모두 꺼집니다. 단, 다른 활성 attack vector에도 완화가 필요하거나 취약점별 command line option으로 완화를 명시한 경우는 예외입니다.
다섯 가지 공격 벡터
attack_vector_controls.rst:1-128user, kernel, guest, host와 SMT sibling 사이 신뢰 경계를 나누고 각 완화의 기본 활성 상태를 설명합니다.