Skip to content

Commit ffbdbf3

Browse files
committed
Merge tag 'v6.6.106' into 6.6-main
This is the 6.6.106 stable release # -----BEGIN PGP SIGNATURE----- # # iQIzBAABCgAdFiEEZH8oZUiU471FcZm+ONu9yGCSaT4FAmjC6MkACgkQONu9yGCS # aT6oOBAA1tLCDhHwJHx1MDbhcaQUYZdyxN+2vAC0utk4wRg1peUo9qh5rqO7gvB+ # OF3QfVbxZCvOR9JxI3kkkhyXKdSoJz5XpXTZ/YWsAZidLwfCr+Y9oM3T2gQkqdbe # lA+liP/FWQDhIX7ZiLk0Hd0g+LGQT0sQ2BiQLDGxk73uYu+V+azysbG3KEIdrn2g # JcpAPcD6i139kyVpN+cXwwaWfysGzO4OhIvfP8dXDs10xSvIpPIIBwMqCiIxyvah # L2Oa0n7kWHuMCANtitANfkkL9gknmW+KVcQojWYQ0+IessCh8yn1U9vA3txWrd0E # M+WpgEbTBbCX1kNHE1XUxhIGBxlJjUEF8oKT16VQS/jQpoIDvhPQ2U7f01tB/Jcx # EEqmfl/1jEWLv/4y7NUZvgAdaXsHT/XZK1XeAVY/XwbSkkRLDvoxhuwGGJVVtNHL # frCYBouzLyuUm3zyJUM0lhI64kkS+UDlJyVYH7f0yToqU8rlQKb0lTuhAO5bofKR # F+KnJ+meq1AV7ZZD5BXLzKQocn9mKnM3yYKxaKS0+TCl8HWdXuKRSzqAezC/iLzF # Phb4wBo8mjULxSLFp1dKNdAczwKQd0MFp+hxYPg032lGCD6rnwvr8QU99wmPBl3D # b5TQiGy3YBfvpHdfEJLatRKDYXv1ePOMhvinsK2fBVXNW+fNi0Y= # =9R97 # -----END PGP SIGNATURE----- # gpg: Signature made Thu Sep 11 17:20:41 2025 CEST # gpg: using RSA key 647F28654894E3BD457199BE38DBBDC86092693E # gpg: Can't check signature: No public key
2 parents d99cba8 + 60a9e71 commit ffbdbf3

14 files changed

Lines changed: 392 additions & 105 deletions

File tree

Documentation/ABI/testing/sysfs-devices-system-cpu

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -528,6 +528,7 @@ What: /sys/devices/system/cpu/vulnerabilities
528528
/sys/devices/system/cpu/vulnerabilities/srbds
529529
/sys/devices/system/cpu/vulnerabilities/tsa
530530
/sys/devices/system/cpu/vulnerabilities/tsx_async_abort
531+
/sys/devices/system/cpu/vulnerabilities/vmscape
531532
Date: January 2018
532533
Contact: Linux kernel mailing list <linux-kernel@vger.kernel.org>
533534
Description: Information about CPU vulnerabilities

Documentation/admin-guide/hw-vuln/index.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,3 +23,4 @@ are configurable at compile, boot or run time.
2323
gather_data_sampling
2424
reg-file-data-sampling
2525
indirect-target-selection
26+
vmscape
Lines changed: 110 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,110 @@
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.

Documentation/admin-guide/kernel-parameters.txt

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3368,6 +3368,7 @@
33683368
srbds=off [X86,INTEL]
33693369
ssbd=force-off [ARM64]
33703370
tsx_async_abort=off [X86]
3371+
vmscape=off [X86]
33713372

33723373
Exceptions:
33733374
This does not have any effect on
@@ -7074,6 +7075,16 @@
70747075
vmpoff= [KNL,S390] Perform z/VM CP command after power off.
70757076
Format: <command>
70767077

7078+
vmscape= [X86] Controls mitigation for VMscape attacks.
7079+
VMscape attacks can leak information from a userspace
7080+
hypervisor to a guest via speculative side-channels.
7081+
7082+
off - disable the mitigation
7083+
ibpb - use Indirect Branch Prediction Barrier
7084+
(IBPB) mitigation (default)
7085+
force - force vulnerability detection even on
7086+
unaffected processors
7087+
70777088
vsyscall= [X86-64]
70787089
Controls the behavior of vsyscalls (i.e. calls to
70797090
fixed addresses of 0xffffffffff600x00 from legacy

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# SPDX-License-Identifier: GPL-2.0
22
VERSION = 6
33
PATCHLEVEL = 6
4-
SUBLEVEL = 105
4+
SUBLEVEL = 106
55
EXTRAVERSION =
66
NAME = Pinguïn Aangedreven
77

arch/x86/Kconfig

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2630,6 +2630,15 @@ config MITIGATION_TSA
26302630
security vulnerability on AMD CPUs which can lead to forwarding of
26312631
invalid info to subsequent instructions and thus can affect their
26322632
timing and thereby cause a leakage.
2633+
2634+
config MITIGATION_VMSCAPE
2635+
bool "Mitigate VMSCAPE"
2636+
depends on KVM
2637+
default y
2638+
help
2639+
Enable mitigation for VMSCAPE attacks. VMSCAPE is a hardware security
2640+
vulnerability on Intel and AMD CPUs that may allow a guest to do
2641+
Spectre v2 style attacks on userspace hypervisor.
26332642
endif
26342643

26352644
config ARCH_HAS_ADD_PAGES

arch/x86/include/asm/cpufeatures.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -475,6 +475,7 @@
475475
#define X86_FEATURE_TSA_SQ_NO (21*32+11) /* "" AMD CPU not vulnerable to TSA-SQ */
476476
#define X86_FEATURE_TSA_L1_NO (21*32+12) /* "" AMD CPU not vulnerable to TSA-L1 */
477477
#define X86_FEATURE_CLEAR_CPU_BUF_VM (21*32+13) /* "" Clear CPU buffers using VERW before VMRUN */
478+
#define X86_FEATURE_IBPB_EXIT_TO_USER (21*32+14) /* Use IBPB on exit-to-userspace, see VMSCAPE bug */
478479

479480
/*
480481
* BUG word(s)
@@ -528,4 +529,5 @@
528529
#define X86_BUG_ITS X86_BUG(1*32 + 5) /* CPU is affected by Indirect Target Selection */
529530
#define X86_BUG_ITS_NATIVE_ONLY X86_BUG(1*32 + 6) /* CPU is affected by ITS, VMX is not affected */
530531
#define X86_BUG_TSA X86_BUG(1*32+ 9) /* "tsa" CPU is affected by Transient Scheduler Attacks */
532+
#define X86_BUG_VMSCAPE X86_BUG( 1*32+10) /* "vmscape" CPU is affected by VMSCAPE attacks from guests */
531533
#endif /* _ASM_X86_CPUFEATURES_H */

arch/x86/include/asm/entry-common.h

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,13 @@ static inline void arch_exit_to_user_mode_prepare(struct pt_regs *regs,
8383
* 8 (ia32) bits.
8484
*/
8585
choose_random_kstack_offset(rdtsc());
86+
87+
/* Avoid unnecessary reads of 'x86_ibpb_exit_to_user' */
88+
if (cpu_feature_enabled(X86_FEATURE_IBPB_EXIT_TO_USER) &&
89+
this_cpu_read(x86_ibpb_exit_to_user)) {
90+
indirect_branch_prediction_barrier();
91+
this_cpu_write(x86_ibpb_exit_to_user, false);
92+
}
8693
}
8794
#define arch_exit_to_user_mode_prepare arch_exit_to_user_mode_prepare
8895

arch/x86/include/asm/nospec-branch.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -559,6 +559,8 @@ void alternative_msr_write(unsigned int msr, u64 val, unsigned int feature)
559559

560560
extern u64 x86_pred_cmd;
561561

562+
DECLARE_PER_CPU(bool, x86_ibpb_exit_to_user);
563+
562564
static inline void indirect_branch_prediction_barrier(void)
563565
{
564566
alternative_msr_write(MSR_IA32_PRED_CMD, x86_pred_cmd, X86_FEATURE_USE_IBPB);

0 commit comments

Comments
 (0)