Skip to content

Commit 78bfeff

Browse files
committed
Merge tag 'v6.12.47' into 6.12-main
This is the 6.12.47 stable release # -----BEGIN PGP SIGNATURE----- # # iQIzBAABCgAdFiEEZH8oZUiU471FcZm+ONu9yGCSaT4FAmjC6SoACgkQONu9yGCS # aT7O8Q//SfEDCryKst+eY9mLfDMULG0s+0nxhAWpuP2rK+YkQuXmUellVDFSYpdG # DzKanK7CmPAuhl0Of0UjQbAByywwX2V56Y1+xGccduZYfgh/m0DQsB00D8DeQA85 # axKwSmw2t0jVNPGwBusKmWJ9D1Ef8/Lp2tZhjJJ61p4mYnOBP1Itz29M7vTIoD8u # x2/5In98N1+T1/QGVe4tuj9uswFRohbAJo4XEA+/fApApEo/+dLNh8GoaJUTHsSe # cF2TNgApAazJ7u7R8WEuwifwiFtwmZnXfX7VQ4uPNhkRaTMkz7+UFyGSApl5arTs # iGpV2IAIuQrl3810pY+5e9cGXY6RyD9oxcoTUgm8qtLzA0VOmChC7+m50lxqYB+d # 5ur9vFk3YZFp8gcl4anXf9TvfQaf/TIW9ZyFyAz24zKfWlW55OOoHo1rFiJR47zi # LjJIeqbERsv1vK37QRJBEvWJHnAtP0fTNRKqb+v5R76FR+BEFV4TtrBKMrwERrPW # kIK7Dnc884eafYN2qgcdG86jmea1+y/gzDu7se/6RgYralOfmd1aTBvHx1QYnxwW # b3EnjBnALeWdarWXwUiF0HYqH8OW3Tfl4/GJUIUNPCOj1NnPpXGHm9liumi5nfz9 # +iLuxGA10nCHiXElaQSZhk9zAUFQsd75oHEUiRHYxkLCxsmN7oo= # =kadx # -----END PGP SIGNATURE----- # gpg: Signature made Thu Sep 11 17:22:18 2025 CEST # gpg: using RSA key 647F28654894E3BD457199BE38DBBDC86092693E # gpg: Can't check signature: No public key
2 parents 34fa2d5 + f6cf124 commit 78bfeff

14 files changed

Lines changed: 394 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
@@ -525,6 +525,7 @@ What: /sys/devices/system/cpu/vulnerabilities
525525
/sys/devices/system/cpu/vulnerabilities/srbds
526526
/sys/devices/system/cpu/vulnerabilities/tsa
527527
/sys/devices/system/cpu/vulnerabilities/tsx_async_abort
528+
/sys/devices/system/cpu/vulnerabilities/vmscape
528529
Date: January 2018
529530
Contact: Linux kernel mailing list <linux-kernel@vger.kernel.org>
530531
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
@@ -3548,6 +3548,7 @@
35483548
srbds=off [X86,INTEL]
35493549
ssbd=force-off [ARM64]
35503550
tsx_async_abort=off [X86]
3551+
vmscape=off [X86]
35513552

35523553
Exceptions:
35533554
This does not have any effect on
@@ -7425,6 +7426,16 @@
74257426
vmpoff= [KNL,S390] Perform z/VM CP command after power off.
74267427
Format: <command>
74277428

7429+
vmscape= [X86] Controls mitigation for VMscape attacks.
7430+
VMscape attacks can leak information from a userspace
7431+
hypervisor to a guest via speculative side-channels.
7432+
7433+
off - disable the mitigation
7434+
ibpb - use Indirect Branch Prediction Barrier
7435+
(IBPB) mitigation (default)
7436+
force - force vulnerability detection even on
7437+
unaffected processors
7438+
74287439
vsyscall= [X86-64,EARLY]
74297440
Controls the behavior of vsyscalls (i.e. calls to
74307441
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 = 12
4-
SUBLEVEL = 46
4+
SUBLEVEL = 47
55
EXTRAVERSION =
66
NAME = Baby Opossum Posse
77

arch/x86/Kconfig

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2769,6 +2769,15 @@ config MITIGATION_TSA
27692769
security vulnerability on AMD CPUs which can lead to forwarding of
27702770
invalid info to subsequent instructions and thus can affect their
27712771
timing and thereby cause a leakage.
2772+
2773+
config MITIGATION_VMSCAPE
2774+
bool "Mitigate VMSCAPE"
2775+
depends on KVM
2776+
default y
2777+
help
2778+
Enable mitigation for VMSCAPE attacks. VMSCAPE is a hardware security
2779+
vulnerability on Intel and AMD CPUs that may allow a guest to do
2780+
Spectre v2 style attacks on userspace hypervisor.
27722781
endif
27732782

27742783
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
@@ -482,6 +482,7 @@
482482
#define X86_FEATURE_TSA_SQ_NO (21*32+11) /* AMD CPU not vulnerable to TSA-SQ */
483483
#define X86_FEATURE_TSA_L1_NO (21*32+12) /* AMD CPU not vulnerable to TSA-L1 */
484484
#define X86_FEATURE_CLEAR_CPU_BUF_VM (21*32+13) /* Clear CPU buffers using VERW before VMRUN */
485+
#define X86_FEATURE_IBPB_EXIT_TO_USER (21*32+14) /* Use IBPB on exit-to-userspace, see VMSCAPE bug */
485486

486487
/*
487488
* BUG word(s)
@@ -536,4 +537,5 @@
536537
#define X86_BUG_ITS X86_BUG(1*32 + 5) /* "its" CPU is affected by Indirect Target Selection */
537538
#define X86_BUG_ITS_NATIVE_ONLY X86_BUG(1*32 + 6) /* "its_native_only" CPU is affected by ITS, VMX is not affected */
538539
#define X86_BUG_TSA X86_BUG( 1*32+ 9) /* "tsa" CPU is affected by Transient Scheduler Attacks */
540+
#define X86_BUG_VMSCAPE X86_BUG( 1*32+10) /* "vmscape" CPU is affected by VMSCAPE attacks from guests */
539541
#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
@@ -92,6 +92,13 @@ static inline void arch_exit_to_user_mode_prepare(struct pt_regs *regs,
9292
* 8 (ia32) bits.
9393
*/
9494
choose_random_kstack_offset(rdtsc());
95+
96+
/* Avoid unnecessary reads of 'x86_ibpb_exit_to_user' */
97+
if (cpu_feature_enabled(X86_FEATURE_IBPB_EXIT_TO_USER) &&
98+
this_cpu_read(x86_ibpb_exit_to_user)) {
99+
indirect_branch_prediction_barrier();
100+
this_cpu_write(x86_ibpb_exit_to_user, false);
101+
}
95102
}
96103
#define arch_exit_to_user_mode_prepare arch_exit_to_user_mode_prepare
97104

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

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

550550
extern u64 x86_pred_cmd;
551551

552+
DECLARE_PER_CPU(bool, x86_ibpb_exit_to_user);
553+
552554
static inline void indirect_branch_prediction_barrier(void)
553555
{
554556
alternative_msr_write(MSR_IA32_PRED_CMD, x86_pred_cmd, X86_FEATURE_USE_IBPB);

0 commit comments

Comments
 (0)