KernelScan.io

HIGH Introduced in 6.18

kvm ShadowStack OOB

CVE-2026-99120

CVSS 8.7 / 10.0 KernelScan AI

CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:C/C:H/I:L/A:H

01

In the Linux kernel, the following vulnerability has been resolved: KVM: x86/mmu: Cope with the SS bit being set in #NPF exit codes When running Hyper-V from Windows 11, KVM is seeing the SS bit set in nested page fault error codes produced for shadowed NPT. The AMD manual is unclear about when SS is set, including whether it can be set when SupervisorShadowStackEn (bit 6) is not set in the MISC_CTL field of the VMCB. Nevertheless, the unexpected SS bit causes out of bounds accesses in permission_fault(), seen as either WARNs or UBSAN reports: kernel: UBSAN: array-index-out-of-bounds in arch/x86/kvm/mmu.h:225:27 kernel: index 34 is out of range for type 'u16 [16]' (in this case, the page fault error code is 34*2=0x44, i.e. SS|U; the report shows SS|U|W happening as well). Fix the handling of unknown error codes by dropping SS and (with a WARN) any bits not among those that permission_fault() expects to receive. At the same time, given the uncertainty about when hardware sets SS, follow the processor's behavior when constructing the fault's error code, and preserve the SS bit as passed to FNAME(walk_addr_generic). While the behavior is surprising, there's a possibility that Hyper-V expects it (Hyper-V does not even enable CET unless it finds MBEC/GMET!), so retain the information when reflecting the fault to L1 instead of unconditionally discarding it. Bisection shows that this started happening with commit 687ee95c1b6d ("KVM: nSVM: enable GMET for guests"), even though SHSTK was available to guests since Linux 6.18. However, this is not because bit 1 of MISC_CTL (GMET) somehow enables reporting the SS bit; rather, it's simply that Hyper-V never uses CET unless GMET is also present. The WARN is reproducible even with gmet=0, with some hacking of kvm-unit-tests's cet.c testcase to ensure that the first access to the shadow stack triggers a page fault.

02

Engine v0.9.0

Risk summary

A nested VM (L2 guest) running on AMD hardware with KVM nested virtualization can trigger an out-of-bounds read in the host kernel by generating a nested page fault with the Shadow Stack (SS) bit set in the error code. This allows an attacker in the L2 guest to read host kernel memory and potentially crash the host, constituting a VM escape. Cloud providers running multi-tenant workloads with nested virtualization enabled are primarily at risk.

Affectedarch/x86/kvm/mmu.h (KVM x86 MMU)

Vulnerability analysis

The KVM x86 MMU's permission_fault() function uses the page fault error code as an index into a fixed 16-element permissions array. When Hyper-V runs as an L2 guest on Windows 11, the AMD processor sets the Shadow Stack (SS) bit in the nested page fault error code even when shadow stack virtualization is not explicitly enabled, producing index values like 34 that exceed the array bounds. This causes an out-of-bounds kernel memory read, reported by UBSAN as an array-index-out-of-bounds error. The fix strips the SS bit before computing the array index and adds a warning for any other unexpected error code bits, while preserving the SS bit when reflecting the fault back to the L1 guest so that Hyper-V receives the error code it expects. The vulnerability is reachable by any L2 guest that can trigger a shadow stack page fault — typically requiring only user-mode code execution in the guest — and affects hosts running KVM with AMD SVM nested virtualization.

03

BranchIntroducedFixed inPatch commit
6.186.186.18.590caeefed99b3
7.26.187.2.13d6e08ec2fff4
mainline6.187.3e90ab3669181