CVE-2025-38351: kernel: KVM: x86/hyper-v: Skip non-canonical addresses during PV TLB flush
Component: kernel
Severity: Moderate
CWE: CWE-754 (Improper Check for Unusual or Exceptional Conditions)
CVSS v3: 7.3 (CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:C/C:N/I:L/A:H)
Public date: 2025-07-19T00:00:00+00:00

In the Linux kernel, the following vulnerability has been resolved:

KVM: x86/hyper-v: Skip non-canonical addresses during PV TLB flush

In KVM guests with Hyper-V hypercalls enabled, the hypercalls
HVCALL_FLUSH_VIRTUAL_ADDRESS_LIST and HVCALL_FLUSH_VIRTUAL_ADDRESS_LIST_EX
allow a guest to request invalidation of portions of a virtual TLB.
For this, the hypercall parameter includes a list of GVAs that are supposed
to be invalidated.

However, when non-canonical GVAs are passed, there is currently no
filtering in place and they are eventually passed to checked invocations of
INVVPID on Intel / INVLPGA on AMD.  While AMD's INVLPGA silently ignores
non-canonical addresses (effectively a no-op), Intel's INVVPID explicitly
signals VM-Fail and ultimately triggers the WARN_ONCE in invvpid_error():

  invvpid failed: ext=0x0 vpid=1 gva=0xaaaaaaaaaaaaa000
  WARNING: CPU: 6 PID: 326 at arch/x86/kvm/vmx/vmx.c:482
  invvpid_error+0x91/0xa0 [kvm_intel]
  Modules linked in: kvm_intel kvm 9pnet_virtio irqbypass fuse
  CPU: 6 UID: 0 PID: 326 Comm: kvm-vm Not tainted 6.15.0 #14 PREEMPT(voluntary)
  RIP: 0010:invvpid_error+0x91/0xa0 [kvm_intel]
  Call Trace:
    vmx_flush_tlb_gva+0x320/0x490 [kvm_intel]
    kvm_hv_vcpu_flush_tlb+0x24f/0x4f0 [kvm]
    kvm_arch_vcpu_ioctl_run+0x3013/0x5810 [kvm]

Hyper-V documents that invalid GVAs (those that are beyond a partition's
GVA space) are to be ignored.  While not completely clear whether this
ruling also applies to non-canonical GVAs, it is likely fine to make that
assumption, and manual testing on Azure confirms "real" Hyper-V interprets
the specification in the same way.

Skip non-canonical GVAs when processing the list of address to avoid
tripping the INVVPID failure.  Alternatively, KVM could filter out "bad"
GVAs before inserting into the FIFO, but practically speaking the only
downside of pushing validation to the final processing is that doing so
is suboptimal for the guest, and no well-behaved guest will request TLB
flushes for non-canonical addresses.

Statement: While not a memory corruption or LPE, this is guest-triggerable denial-of-service with privileged instructions, which makes it relevant in cloud environments using nested virtualization or hosting untrusted workloads (e.g., CI systems, fuzzing infrastructure, research clusters).

The issue was confirmed and the fix validated by testing on Azure (which implements Hyper-V).

A denial-of-service vulnerability was found in the KVM module of the Linux kernel when handling paravirtualized TLB flush hypercalls (HVCALL_FLUSH_VIRTUAL_ADDRESS_LIST{,_EX}) under Hyper-V. On Intel hosts, passing non-canonical guest virtual addresses (GVAs) from a guest may trigger a VMFailInvalid condition during INVVPID, leading to WARN_ONCE() or kernel instability.

PR:L is justified because the attacker must have kernel-level privileges inside the guest VM to issue the hypercall.

S:C (scope changed) applies because the bug allows actions within a guest to impact the host kernel’s stability.

CIA: NNH reflects that the issue does not affect confidentiality or integrity, but can significantly affect availability through a potential host crash or soft lockup.

The related to this bug Kernel config param CONFIG_KVM_HYPERV enabled only for the latest version of Red Hat Enterprise Linux 9.

Affected upstream versions: 6.2
Fixed upstream versions: 0, 6.12.41, 6.15.7, 6.16, 6.6.103
Upstream repository: https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
Upstream fix commit: d5784ea45663330eaa868c518ea40e7a9f06aa2d