Skip to main content

Linux Kernel CVE-2025-40038

HIGH
2025-10-28 416baaa9-dc9f-4396-8d5f-8c081fb06d67
7.1
CVSS 3.1 · Vendor: 416baaa9-dc9f-4396-8d5f-8c081fb06d67
Share

Severity by source

Vendor (416baaa9-dc9f-4396-8d5f-8c081fb06d67) PRIMARY
7.1 HIGH
AV:L/AC:L/PR:N/UI:N/S:C/C:N/I:N/A:H
vuln.today AI
5.6 MEDIUM

Local guest-to-host DoS: AC:H because it needs non-default nrips=false, PR:L because the attacker must control a guest, S:C for guest-to-host crossing, availability-only impact (A:H).

3.1 AV:L/AC:H/PR:L/UI:N/S:C/C:N/I:N/A:H
4.0 AV:L/AC:H/AT:N/PR:L/UI:N/VC:N/VI:N/VA:N/SC:N/SI:N/SA:H
SUSE
5.5 MEDIUM
AV:L/AC:L/PR:L/UI:N/S:U/C:N/I:N/A:H
Red Hat
6.1 MEDIUM
qualitative

Primary rating from Vendor (416baaa9-dc9f-4396-8d5f-8c081fb06d67).

CVSS VectorVendor: 416baaa9-dc9f-4396-8d5f-8c081fb06d67

Attack Vector
Local
Attack Complexity
Low
Privileges Required
None
User Interaction
None
Scope
Changed
Confidentiality
None
Integrity
None
Availability
High

Lifecycle Timeline

2
Analysis Generated
Jul 30, 2026 - 07:57 vuln.today
CVE Published
Oct 28, 2025 - 12:15 cve.org
HIGH 7.1

DescriptionCVE.org

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

KVM: SVM: Skip fastpath emulation on VM-Exit if next RIP isn't valid

Skip the WRMSR and HLT fastpaths in SVM's VM-Exit handler if the next RIP isn't valid, e.g. because KVM is running with nrips=false. SVM must decode and emulate to skip the instruction if the CPU doesn't provide the next RIP, and getting the instruction bytes to decode requires reading guest memory. Reading guest memory through the emulator can fault, i.e. can sleep, which is disallowed since the fastpath handlers run with IRQs disabled.

BUG: sleeping function called from invalid context at ./include/linux/uaccess.h:106 in_atomic(): 1, irqs_disabled(): 1, non_block: 0, pid: 32611, name: qemu preempt_count: 1, expected: 0 INFO: lockdep is turned off. irq event stamp: 30580 hardirqs last enabled at (30579): [<ffffffffc08b2527>] vcpu_run+0x1787/0x1db0 [kvm] hardirqs last disabled at (30580): [<ffffffffb4f62e32>] __schedule+0x1e2/0xed0 softirqs last enabled at (30570): [<ffffffffb4247a64>] fpu_swap_kvm_fpstate+0x44/0x210 softirqs last disabled at (30568): [<ffffffffb4247a64>] fpu_swap_kvm_fpstate+0x44/0x210 CPU: 298 UID: 0 PID: 32611 Comm: qemu Tainted: G U 6.16.0-smp--e6c618b51cfe-sleep #782 NONE Tainted: [U]=USER Hardware name: Google Astoria-Turin/astoria, BIOS 0.20241223.2-0 01/17/2025 Call Trace: <TASK> dump_stack_lvl+0x7d/0xb0 __might_resched+0x271/0x290 __might_fault+0x28/0x80 kvm_vcpu_read_guest_page+0x8d/0xc0 [kvm] kvm_fetch_guest_virt+0x92/0xc0 [kvm] __do_insn_fetch_bytes+0xf3/0x1e0 [kvm] x86_decode_insn+0xd1/0x1010 [kvm] x86_emulate_instruction+0x105/0x810 [kvm] __svm_skip_emulated_instruction+0xc4/0x140 [kvm_amd] handle_fastpath_invd+0xc4/0x1a0 [kvm] vcpu_run+0x11a1/0x1db0 [kvm] kvm_arch_vcpu_ioctl_run+0x5cc/0x730 [kvm] kvm_vcpu_ioctl+0x578/0x6a0 [kvm] __se_sys_ioctl+0x6d/0xb0 do_syscall_64+0x8a/0x2c0 entry_SYSCALL_64_after_hwframe+0x4b/0x53 RIP: 0033:0x7f479d57a94b </TASK>

Note, this is essentially a reapply of commit 5c30e8101e8d ("KVM: SVM: Skip WRMSR fastpath on VM-Exit if next RIP isn't valid"), but with different justification (KVM now grabs SRCU when skipping the instruction for other reasons).

AnalysisAI

Host denial-of-service in the Linux kernel's KVM AMD (SVM) subsystem allows a guest VM to crash or hang the hypervisor host when the CPU/host is running with next-RIP support disabled (nrips=false). In that mode the WRMSR, HLT and INVD VM-Exit fastpath handlers attempt to decode and emulate the guest instruction to advance RIP, which reads guest memory and can sleep - but these handlers run with IRQs disabled, triggering a 'sleeping function called from invalid context' BUG and destabilizing the host. There is no public exploit identified at time of analysis, and EPSS is low (0.20%, 10th percentile); despite the 7.1 CVSS the scope-changed availability impact is gated by a non-default configuration.

Technical ContextAI

The flaw lives in KVM's AMD SVM VM-Exit fastpath. On AMD, when the 'next RIP save' feature is available (nrips=true, the default on modern AMD CPUs), the CPU reports the address of the instruction following the one that caused the exit, so KVM can skip it cheaply. When nrips=false, KVM must instead decode and emulate the faulting instruction to advance RIP, and instruction fetch (kvm_fetch_guest_virt → kvm_vcpu_read_guest_page → __might_fault) can page-fault and sleep. The fastpath handlers (handle_fastpath_invd, plus the WRMSR and HLT fastpaths) execute in atomic context with hardware interrupts disabled, so any sleeping call violates atomicity - captured by lockdep/might_sleep as 'BUG: sleeping function called from invalid context'. The root cause class is invoking a blocking/sleeping operation from an atomic (IRQs-disabled) context, an improper synchronization / locking-context bug; NVD assigns no CWE, but this maps conceptually to CWE-667 (Improper Locking) / sleep-in-atomic. No affected-version CPE strings were supplied in the input; the reproduction was on kernel 6.16.0 on AMD (Google Astoria-Turin/astoria).

Affected ProductsAI

The affected product is the Linux kernel's KVM AMD virtualization module (kvm_amd / SVM). The vulnerability manifests only on AMD hosts running with next-RIP support disabled (nrips=false), as reproduced on Linux 6.16.0 (commit e6c618b51cfe context). No explicit affected-version range, vendor CPE, or NVD CPE list was provided in the input, so precise start/end versions cannot be confirmed from available data. Remediation commits are published in the kernel stable tree: https://git.kernel.org/stable/c/0910dd7c9ad45a2605c45fd2bf3d1bcac087687c , https://git.kernel.org/stable/c/cd3efb93677c4b0cf76348882fb429165fee33fd , https://git.kernel.org/stable/c/da2a3c231f7f2a5ac146d972b8c1d7d84aff6d70 , and https://git.kernel.org/stable/c/f994e9c790ce97d3cf01af4d0a1b9add0c955aee .

RemediationAI

Upstream fix available (PR/commit); released patched version not independently confirmed - apply the kernel update containing the fix that skips the WRMSR/HLT/INVD fastpaths when the next RIP isn't valid, from the stable commits (0910dd7c9ad4, cd3efb93677c, da2a3c231f7f, f994e9c790ce). Consume the fix via your distribution's patched kernel package once it incorporates these backports rather than hand-cherry-picking, then reboot to load the updated kvm_amd module. As a compensating control until patched, ensure AMD next-RIP save is enabled (the default) so the vulnerable emulation path is not taken - i.e. avoid loading kvm_amd with nrips disabled and do not run on hardware/config that lacks next-RIP save; the trade-off is that on CPUs genuinely without nrips support you cannot mitigate via configuration and must patch. Restricting the ability to launch untrusted guest VMs on affected hosts also limits exposure, at the cost of reduced multi-tenancy. Advisory references: the four git.kernel.org/stable commit URLs listed above.

Vendor StatusVendor

SUSE

Severity: Moderate
Product Status
Container suse/hpc/warewulf4-x86_64/sle-hpc-node:latest Image SLES15-SP6 Image SLES15-SP6-BYOS Image SLES15-SP6-BYOS-Azure Image SLES15-SP6-BYOS-EC2 Image SLES15-SP6-BYOS-GCE Image SLES15-SP6-CHOST-BYOS Image SLES15-SP6-CHOST-BYOS-Aliyun Image SLES15-SP6-CHOST-BYOS-Azure Image SLES15-SP6-CHOST-BYOS-EC2 Image SLES15-SP6-CHOST-BYOS-GCE Image SLES15-SP6-CHOST-BYOS-GDC Image SLES15-SP6-CHOST-BYOS-SAP-CCloud Image SLES15-SP6-EC2 Image SLES15-SP6-EC2-ECS-HVM Image SLES15-SP6-GCE Image SLES15-SP6-HPC-BYOS Image SLES15-SP6-HPC-BYOS-Azure Image SLES15-SP6-HPC-BYOS-EC2 Image SLES15-SP6-HPC-BYOS-GCE Image SLES15-SP6-HPC-EC2 Image SLES15-SP6-HPC-GCE Image SLES15-SP6-Hardened-BYOS Image SLES15-SP6-Hardened-BYOS-Azure Image SLES15-SP6-Hardened-BYOS-EC2 Image SLES15-SP6-Hardened-BYOS-GCE Image SLES15-SP6-SAP Image SLES15-SP6-SAP-Azure Image SLES15-SP6-SAP-EC2 Image SLES15-SP6-SAP-GCE Image SLES15-SP6-SAPCAL Image SLES15-SP6-SAPCAL-Azure Image SLES15-SP6-SAPCAL-EC2 Image SLES15-SP6-SAPCAL-GCE Affected
Container suse/sl-micro/6.0/baremetal-os-container:latest Container suse/sl-micro/6.1/baremetal-os-container:latest Affected
Container suse/sl-micro/6.0/base-os-container:2.1.3-7.95 Container suse/sl-micro/6.1/base-os-container:2.2.1-5.80 Affected
Container suse/sl-micro/6.0/kvm-os-container:2.1.3-6.114 Container suse/sl-micro/6.1/kvm-os-container:2.2.1-5.82 Affected
Container suse/sl-micro/6.0/rt-os-container:2.1.3-7.116 Container suse/sl-micro/6.1/rt-os-container:2.2.1-5.55 Affected

Share

CVE-2025-40038 vulnerability details – vuln.today

This site uses cookies essential for authentication and security. No tracking or analytics cookies are used. Privacy Policy