cve.bz

CVE-2025-40038 linux linux

7.1 highEPSS 0.2%Fix available

High (7.1) in linux linux. EPSS 0.2% estimated probability of exploitation activity in the next 30 days.

On this page
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).

Severity

CVSS 3.1

7.1 high
CVSS:3.1/AV:L/AC:L/PR:N/UI:N/S:C/C:N/I:N/A:H
EPSS
0.2% (unchanged from 0.2% a week ago; 0.2% 30 days ago) estimated probability of exploitation activity in the next 30 days; 7th percentile. Scored 2026-11-15. A forecast for this CVE across the internet, not for your own systems.
CISA's assessment (SSVC)
Exploitation: none · Automatable: no · Technical impact: partial, assessed 2026-10-15. From CISA's Vulnrichment in the CVE List: whether it is exploited, whether exploiting it can be automated, and how much control it gives.
Published
Modified
NVD analysis
Deferred: the NVD does not plan to analyze it
Record from
the NVD, synced

Fix and patched versions

  • Linux Linux: fixed in 6.6.113
  • Linux Linux: fixed in 6.12.53
  • Linux Linux: fixed in 6.17.3
  • Linux Linux: fixed in 6.18
  • Debian, Ubuntu, SUSE, openSUSE, Alpaquita: fixed package versions per release

Ask an AI about this CVE

Show the promptExplain CVE-2025-40038 for an engineer deciding whether to act. Use https://cve.bz/api/public/cves/CVE-2025-40038?via=ask-ai-copy and https://cve.bz/cve/CVE-2025-40038?via=ask-ai-copy as the source of truth: what is affected and which versions fix it, whether it is in CISA KEV, public exploits, and its EPSS (an internet-wide 30-day estimate of exploitation activity, not a forecast for my systems). If they give no fixed versions, use the CVE record https://cveawg.mitre.org/api/cve/CVE-2025-40038 or the vendor advisory, not third-party mirrors. Tell me how to check whether I am affected and how to verify a fix. Cite the sources and say where they are uncertain.

Opens a third-party assistant; its answer is its own, not cve.bz's. The prompt holds only this CVE's id and public links.

Affected

Versions

From the CNA's record in the CVE List.

ProductAffected
Linux6.5 and later

Fixed in

ProductRelease lineFixed in
Linux6.66.6.113
Linux6.126.12.53
Linux6.176.17.3
Linuxlater releases6.18

Linux distributions

DistributionReleasePackageFixed inAdvisory
Debian13linux6.12.57-1DEBIAN-CVE-2025-40038
Debian14linux6.17.6-1DEBIAN-CVE-2025-40038
Ubuntu16.04:LTSlinux-hwe-edgeno fix listedUBUNTU-CVE-2025-40038
Ubuntu18.04:LTSlinux-gcp, linux-hwe, linux-oem and 12 moreno fix listedUBUNTU-CVE-2025-40038
Ubuntu20.04:LTSlinux-gke, linux-gkeop, linux-riscv and 26 moreno fix listedUBUNTU-CVE-2025-40038
Ubuntu22.04:LTSlinux-aws-6.86.8.0-1050.53~22.04.1UBUNTU-CVE-2025-40038 USN-8095-4
Ubuntu22.04:LTSlinux-azure-6.86.8.0-1051.57~22.04.1UBUNTU-CVE-2025-40038 USN-8126-1
Ubuntu22.04:LTSlinux-azure-fde-6.86.8.0-1058.65~22.04.1UBUNTU-CVE-2025-40038
Ubuntu22.04:LTSlinux-gcp-6.86.8.0-1052.55~22.04.1UBUNTU-CVE-2025-40038 USN-8095-1
Ubuntu22.04:LTSlinux-hwe-6.8, linux-riscv-6.86.8.0-106.106~22.04.1UBUNTU-CVE-2025-40038 USN-8095-1
Ubuntu22.04:LTSlinux-ibm-6.86.8.0-1049.49~22.04.1UBUNTU-CVE-2025-40038 USN-8095-1
Ubuntu22.04:LTSlinux-lowlatency-hwe-6.86.8.0-106.106.1~22.04.1UBUNTU-CVE-2025-40038 USN-8095-1
Ubuntu22.04:LTSlinux-nvidia-6.86.8.0-1049.52~22.04.1UBUNTU-CVE-2025-40038 USN-8100-1
Ubuntu22.04:LTSlinux-oracle-6.86.8.0-1047.48~22.04.1UBUNTU-CVE-2025-40038 USN-8095-1
38 more for Ubuntu in the JSON and on Ubuntu's page.
SUSELinux Enterprise High Availability Extension 15 SP6, Linux Enterprise Live Patching 15 SP6, Linux Enterprise Module for Legacy 15 SP6 and 1 morekernel-default6.4.0-150600.23.81.3SUSE-SU-2025:4422-1
SUSELinux Enterprise High Availability Extension 15 SP7, Linux Enterprise Live Patching 15 SP7, Linux Enterprise Module for Legacy 15 SP7 and 1 morekernel-default6.4.0-150700.53.25.1SUSE-SU-2025:4393-1
SUSELinux Enterprise High Availability Extension 16.0kernel-default6.12.0-160000.8.1SUSE-SU-2026:20021-1
SUSELinux Enterprise Live Patching 15 SP6kernel-livepatch-SLE15-SP6-RT_Update_181-150600.1.3.1SUSE-SU-2025:4521-1
SUSELinux Enterprise Live Patching 15 SP6kernel-livepatch-SLE15-SP6_Update_181-150600.13.3.3SUSE-SU-2025:4422-1
SUSELinux Enterprise Live Patching 15 SP7kernel-livepatch-SLE15-SP7-RT_Update_71-150700.1.3.1SUSE-SU-2025:4516-1
SUSELinux Enterprise Live Patching 15 SP7kernel-livepatch-SLE15-SP7_Update_71-150700.15.3.1SUSE-SU-2025:4393-1
SUSELinux Enterprise Module for Basesystem 15 SP6kernel-64kb, kernel-default, kernel-zfcpdump6.4.0-150600.23.81.3SUSE-SU-2025:4422-1
SUSELinux Enterprise Module for Basesystem 15 SP6kernel-default-base6.4.0-150600.23.81.3.150600.12.36.3SUSE-SU-2025:4422-1
SUSELinux Enterprise Module for Basesystem 15 SP6, Linux Enterprise Module for Development Tools 15 SP6kernel-source6.4.0-150600.23.81.2SUSE-SU-2025:4422-1
SUSELinux Enterprise Module for Basesystem 15 SP7kernel-64kb, kernel-source, kernel-default and 1 more6.4.0-150700.53.25.1SUSE-SU-2025:4393-1
SUSELinux Enterprise Module for Basesystem 15 SP7kernel-default-base6.4.0-150700.53.25.1.150700.17.17.1SUSE-SU-2025:4393-1
19 more for SUSE in the JSON and on SUSE's page.
openSUSELeap 15.6dtb-aarch64, kernel-docs, kernel-syms and 1 more6.4.0-150600.23.81.1SUSE-SU-2025:4422-1
openSUSELeap 15.6kernel-64kb, kernel-debug, kernel-default and 3 more6.4.0-150600.23.81.3SUSE-SU-2025:4422-1
openSUSELeap 15.6kernel-azure, kernel-syms-azure, kernel-source-azure6.4.0-150600.8.58.1SUSE-SU-2025:4505-1
openSUSELeap 15.6kernel-default-base6.4.0-150600.23.81.3.150600.12.36.3SUSE-SU-2025:4422-1
openSUSELeap 15.6kernel-rt, kernel-syms-rt, kernel-rt_debug and 1 more6.4.0-150600.10.61.1SUSE-SU-2025:4521-1
openSUSELeap 15.6kernel-source6.4.0-150600.23.81.2SUSE-SU-2025:4422-1
openSUSELeap 16.0kernel-default-base6.12.0-160000.8.1.160000.2.5openSUSE-SU-2025:20172-1
openSUSELeap 16.0kernel-rt, dtb-aarch64, kernel-64kb and 8 more6.12.0-160000.8.1openSUSE-SU-2025:20172-1
openSUSETumbleweedkernel-source6.17.7-1.1openSUSE-SU-2025:15702-1
openSUSETumbleweedkernel-source-longterm6.18.16-1.1openSUSE-SU-2026:10301-1
Alpaquita25linux-lts6.12.53-r0BELL-CVE-2025-40038
Alpaquitastreamlinux-lts6.18.35-r1BELL-CVE-2025-40038

From the distributions' data via OSV.dev: the Debian Security Tracker; Ubuntu Security Notices © Canonical Ltd., CC BY-SA 4.0; SUSE security data, CC BY 4.0; BellSoft's OSV database, MIT. Modified: reformatted and linked to CVE records. Credits. On the distributions' own pages: Debian · Ubuntu · SUSE · openSUSE · Alpaquita.

Red Hat

Red Hat rates this Moderate.

Red Hat's statement

KVM SVM’s VM-Exit fastpaths (WRMSR/HLT) ran with IRQs disabled and incorrectly proceeded when next_rip wasn’t available (e.g., nrips=false). Skipping the guest instruction then required decoding it, which reads guest memory and can fault/sleep, triggering “sleeping function in atomic context” and crashing the host. The fix bails out of the fastpath if nrips is disabled or next_rip is zero, ensuring the slow path (which may sleep) is used instead.

ProductPackageStateAdvisory
Red Hat Enterprise Linux 10kernelFix deferred
Red Hat Enterprise Linux 6kernelNot affected
Red Hat Enterprise Linux 7kernelNot affected
Red Hat Enterprise Linux 7kernel-rtNot affected
Red Hat Enterprise Linux 8kernelNot affected
Red Hat Enterprise Linux 8kernel-rtNot affected
Red Hat Enterprise Linux 9kernelFix deferred
Red Hat Enterprise Linux 9kernel-rtFix deferred

Contains Red Hat Security Data © Red Hat, Inc., licensed under CC BY 4.0. Source: https://access.redhat.com/security/data. Modified: reformatted. Red Hat's page for CVE-2025-40038.

References

Check your stackJSON