← Documents Documentation/admin-guide/hw-vuln/vmscape.rst GitHub 원문 ↗

Linux 6.18.37 · Administration / Hardware Vulnerabilities

VMSCAPE

게스트가 호스트 사용자 공간 VMM의 분기 예측에 영향을 주는 VMSCAPE와 조건부 IBPB·STIBP 완화를 설명합니다.

Source pathDocumentation/admin-guide/hw-vuln/vmscape.rst
Source versionLinux v6.18.37
TranslationDUJINLABS 전문 번역 + 해설

요약·해설과 원문, 전문 번역을 서로 분리했습니다. API 이름, symbol, source path는 원문 표기를 사용합니다.

1. 요약·해설

원문의 핵심 논리와 kernel programming 관점의 보충 설명입니다. 아래의 전문 번역과는 별도로 작성했습니다.

공격 경계와 영향 CPU

vmscape.rst:1-31

QEMU 같은 VMM을 통한 confused-deputy 공격과 Intel·AMD·Hygon 영향 범위를 설명합니다.

조건부 IBPB와 SMT

vmscape.rst:32-65

VM-exit 이후 사용자 공간 진입 시점의 IBPB 발행과 SMT 환경의 STIBP 요구 사항을 정리합니다.

상태와 운영 제어

vmscape.rst:66-110

sysfs 상태 4개와 `vmscape=off|ibpb|force` 커널 명령줄 옵션을 설명합니다.

2. 영어 원문 전체

번역 기준이 된 Linux v6.18.37 원문입니다. 줄 번호는 이 버전의 파일 좌표입니다.

원문 전체 펼치기
1 .. SPDX-License-Identifier: GPL-2.0
2
3 VMSCAPE
4 =======
5
6 VMSCAPE is a vulnerability that may allow a guest to influence the branch
7 prediction in host userspace. It particularly affects hypervisors like QEMU.
8
9 Even if a hypervisor may not have any sensitive data like disk encryption keys,
10 guest-userspace may be able to attack the guest-kernel using the hypervisor as
11 a confused deputy.
12
13 Affected processors
14 -------------------
15
16 The following CPU families are affected by VMSCAPE:
17
18 **Intel processors:**
19 - Skylake generation (Parts without Enhanced-IBRS)
20 - Cascade Lake generation - (Parts affected by ITS guest/host separation)
21 - Alder Lake and newer (Parts affected by BHI)
22
23 Note that, BHI affected parts that use BHB clearing software mitigation e.g.
24 Icelake are not vulnerable to VMSCAPE.
25
26 **AMD processors:**
27 - Zen series (families 0x17, 0x19, 0x1a)
28
29 ** Hygon processors:**
30 - Family 0x18
31
32 Mitigation
33 ----------
34
35 Conditional IBPB
36 ----------------
37
38 Kernel tracks when a CPU has run a potentially malicious guest and issues an
39 IBPB before the first exit to userspace after VM-exit. If userspace did not run
40 between VM-exit and the next VM-entry, no IBPB is issued.
41
42 Note that the existing userspace mitigation against Spectre-v2 is effective in
43 protecting the userspace. They are insufficient to protect the userspace VMMs
44 from a malicious guest. This is because Spectre-v2 mitigations are applied at
45 context switch time, while the userspace VMM can run after a VM-exit without a
46 context switch.
47
48 Vulnerability enumeration and mitigation is not applied inside a guest. This is
49 because nested hypervisors should already be deploying IBPB to isolate
50 themselves from nested guests.
51
52 SMT considerations
53 ------------------
54
55 When Simultaneous Multi-Threading (SMT) is enabled, hypervisors can be
56 vulnerable to cross-thread attacks. For complete protection against VMSCAPE
57 attacks in SMT environments, STIBP should be enabled.
58
59 The kernel will issue a warning if SMT is enabled without adequate STIBP
60 protection. Warning is not issued when:
61
62 - SMT is disabled
63 - STIBP is enabled system-wide
64 - Intel eIBRS is enabled (which implies STIBP protection)
65
66 System information and options
67 ------------------------------
68
69 The sysfs file showing VMSCAPE mitigation status is:
70
71 /sys/devices/system/cpu/vulnerabilities/vmscape
72
73 The possible values in this file are:
74
75 * 'Not affected':
76
77 The processor is not vulnerable to VMSCAPE attacks.
78
79 * 'Vulnerable':
80
81 The processor is vulnerable and no mitigation has been applied.
82
83 * 'Mitigation: IBPB before exit to userspace':
84
85 Conditional IBPB mitigation is enabled. The kernel tracks when a CPU has
86 run a potentially malicious guest and issues an IBPB before the first
87 exit to userspace after VM-exit.
88
89 * 'Mitigation: IBPB on VMEXIT':
90
91 IBPB is issued on every VM-exit. This occurs when other mitigations like
92 RETBLEED or SRSO are already issuing IBPB on VM-exit.
93
94 Mitigation control on the kernel command line
95 ----------------------------------------------
96
97 The mitigation can be controlled via the ``vmscape=`` command line parameter:
98
99 * ``vmscape=off``:
100
101 Disable the VMSCAPE mitigation.
102
103 * ``vmscape=ibpb``:
104
105 Enable conditional IBPB mitigation (default when CONFIG_MITIGATION_VMSCAPE=y).
106
107 * ``vmscape=force``:
108
109 Force vulnerability detection and mitigation even on processors that are
110 not known to be affected.
111

3. 한국어 전문 번역

영어 원문의 문단 순서와 의미를 유지한 전체 번역입니다. 코드, 함수명, symbol과 URL은 원문 표기를 유지합니다.

VMSCAPE 개요와 영향받는 프로세서

1-31

이 문서는 `GPL-2.0` SPDX 라이선스로 제공됩니다.

VMSCAPE는 게스트가 호스트 사용자 공간의 분기 예측에 영향을 줄 수 있는 취약점입니다. 특히 QEMU 같은 하이퍼바이저에 영향을 줍니다.

하이퍼바이저 자체에 디스크 암호화 키 같은 민감한 데이터가 없더라도, 게스트 사용자 공간이 하이퍼바이저를 혼동된 대리자(confused deputy)로 이용해 게스트 커널을 공격할 수 있습니다.

영향받는 프로세서

다음 CPU 계열이 VMSCAPE의 영향을 받습니다.

  • Intel Skylake 세대: Enhanced IBRS가 없는 제품
  • Intel Cascade Lake 세대: ITS 게스트/호스트 분리의 영향을 받는 제품
  • Intel Alder Lake 이후 세대: BHI의 영향을 받는 제품
  • AMD Zen 계열: family 0x17, 0x19, 0x1a
  • Hygon family 0x18

BHI의 영향을 받더라도 Ice Lake처럼 BHB 초기화 소프트웨어 완화를 사용하는 제품은 VMSCAPE에 취약하지 않습니다.

조건부 IBPB 완화

32-51

완화

조건부 IBPB

커널은 CPU가 잠재적으로 악성인 게스트를 실행했는지 추적하고, VM-exit 이후 사용자 공간으로 처음 나가기 전에 IBPB를 발행합니다. VM-exit과 다음 VM-entry 사이에 사용자 공간이 실행되지 않았다면 IBPB를 발행하지 않습니다.

기존 Spectre-v2 사용자 공간 완화는 사용자 공간 자체를 보호하는 데 효과적이지만, 악성 게스트로부터 사용자 공간 VMM을 보호하기에는 부족합니다. Spectre-v2 완화는 문맥 전환 시 적용되는 반면 사용자 공간 VMM은 VM-exit 뒤 문맥 전환 없이 실행될 수 있기 때문입니다.

게스트 내부에서는 취약점 열거와 완화를 적용하지 않습니다. 중첩 하이퍼바이저는 이미 중첩 게스트와 자신을 격리하기 위해 IBPB를 배치해야 하기 때문입니다.

SMT 고려 사항

52-65

Simultaneous Multi-Threading(SMT)이 활성화되면 하이퍼바이저가 스레드 간 공격에 취약할 수 있습니다. SMT 환경에서 VMSCAPE 공격을 완전히 막으려면 STIBP를 활성화해야 합니다.

충분한 STIBP 보호 없이 SMT가 활성화되면 커널이 경고를 출력합니다. 다음 조건에서는 경고하지 않습니다.

  • SMT가 비활성화되어 있습니다.
  • STIBP가 시스템 전체에 활성화되어 있습니다.
  • Intel eIBRS가 활성화되어 있습니다. 이는 STIBP 보호를 포함합니다.

시스템 정보와 sysfs 상태

66-93

VMSCAPE 완화 상태를 표시하는 sysfs 파일은 다음과 같습니다.

/sys/devices/system/cpu/vulnerabilities/vmscape

이 파일에 가능한 값은 다음과 같습니다.

상태의미
Not affected프로세서가 VMSCAPE 공격에 취약하지 않습니다.
Vulnerable프로세서가 취약하며 완화가 적용되지 않았습니다.
Mitigation: IBPB before exit to userspace조건부 IBPB 완화가 활성화되어 있습니다. 커널은 CPU가 잠재적으로 악성인 게스트를 실행했는지 추적하고 VM-exit 이후 사용자 공간으로 처음 나가기 전에 IBPB를 발행합니다.
Mitigation: IBPB on VMEXIT모든 VM-exit에서 IBPB를 발행합니다. RETBLEED나 SRSO 같은 다른 완화가 이미 VM-exit에서 IBPB를 발행할 때 이 상태가 됩니다.

커널 명령줄 완화 제어

94-110

`vmscape=` 커널 명령줄 매개변수로 완화를 제어할 수 있습니다.

옵션동작
vmscape=offVMSCAPE 완화를 비활성화합니다.
vmscape=ibpb`CONFIG_MITIGATION_VMSCAPE=y`일 때 기본값인 조건부 IBPB 완화를 활성화합니다.
vmscape=force영향받는 것으로 알려지지 않은 프로세서에서도 취약점 탐지와 완화를 강제로 적용합니다.