Linux Kernel
CVE-2024-26976
HIGH
Severity by source
AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H
Local access with KVM device permissions (PR:L) required; module use-after-free justifies C:H/I:H; confirmed kernel deadlock drives A:H.
Primary rating from Vendor (416baaa9-dc9f-4396-8d5f-8c081fb06d67).
CVSS VectorVendor: 416baaa9-dc9f-4396-8d5f-8c081fb06d67
Lifecycle Timeline
6DescriptionCVE.org
In the Linux kernel, the following vulnerability has been resolved:
KVM: Always flush async #PF workqueue when vCPU is being destroyed
Always flush the per-vCPU async #PF workqueue when a vCPU is clearing its completion queue, e.g. when a VM and all its vCPUs is being destroyed. KVM must ensure that none of its workqueue callbacks is running when the last reference to the KVM _module_ is put. Gifting a reference to the associated VM prevents the workqueue callback from dereferencing freed vCPU/VM memory, but does not prevent the KVM module from being unloaded before the callback completes.
Drop the misguided VM refcount gifting, as calling kvm_put_kvm() from async_pf_execute() if kvm_put_kvm() flushes the async #PF workqueue will result in deadlock. async_pf_execute() can't return until kvm_put_kvm() finishes, and kvm_put_kvm() can't return until async_pf_execute() finishes:
WARNING: CPU: 8 PID: 251 at virt/kvm/kvm_main.c:1435 kvm_put_kvm+0x2d/0x320 [kvm] Modules linked in: vhost_net vhost vhost_iotlb tap kvm_intel kvm irqbypass CPU: 8 PID: 251 Comm: kworker/8:1 Tainted: G W 6.6.0-rc1-e7af8d17224a-x86/gmem-vm #119 Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 0.0.0 02/06/2015 Workqueue: events async_pf_execute [kvm] RIP: 0010:kvm_put_kvm+0x2d/0x320 [kvm] Call Trace: <TASK> async_pf_execute+0x198/0x260 [kvm] process_one_work+0x145/0x2d0 worker_thread+0x27e/0x3a0 kthread+0xba/0xe0 ret_from_fork+0x2d/0x50 ret_from_fork_asm+0x11/0x20 </TASK> ---[ end trace 0000000000000000 ]--- INFO: task kworker/8:1:251 blocked for more than 120 seconds. Tainted: G W 6.6.0-rc1-e7af8d17224a-x86/gmem-vm #119 "echo 0 > /proc/sys/kernel/hung_task_timeout_secs" disables this message. task:kworker/8:1 state:D stack:0 pid:251 ppid:2 flags:0x00004000 Workqueue: events async_pf_execute [kvm] Call Trace: <TASK> __schedule+0x33f/0xa40 schedule+0x53/0xc0 schedule_timeout+0x12a/0x140 __wait_for_common+0x8d/0x1d0 __flush_work.isra.0+0x19f/0x2c0 kvm_clear_async_pf_completion_queue+0x129/0x190 [kvm] kvm_arch_destroy_vm+0x78/0x1b0 [kvm] kvm_put_kvm+0x1c1/0x320 [kvm] async_pf_execute+0x198/0x260 [kvm] process_one_work+0x145/0x2d0 worker_thread+0x27e/0x3a0 kthread+0xba/0xe0 ret_from_fork+0x2d/0x50 ret_from_fork_asm+0x11/0x20 </TASK>
If kvm_clear_async_pf_completion_queue() actually flushes the workqueue, then there's no need to gift async_pf_execute() a reference because all invocations of async_pf_execute() will be forced to complete before the vCPU and its VM are destroyed/freed. And that in turn fixes the module unloading bug as __fput() won't do module_put() on the last vCPU reference until the vCPU has been freed, e.g. if closing the vCPU file also puts the last reference to the KVM module.
Note that kvm_check_async_pf_completion() may also take the work item off the completion queue and so also needs to flush the work queue, as the work will not be seen by kvm_clear_async_pf_completion_queue(). Waiting on the workqueue could theoretically delay a vCPU due to waiting for the work to complete, but that's a very, very small chance, and likely a very small delay. kvm_arch_async_page_present_queued() unconditionally makes a new request, i.e. will effectively delay entering the guest, so the remaining work is really just:
trace_kvm_async_pf_completed(addr, cr2_or_gpa);
__kvm_vcpu_wake_up(vcpu);
mmput(mm);
and mmput() can't drop the last reference to the page tables if the vCPU is still alive, i.e. the vCPU won't get stuck tearing down page tables.
Add a helper to do the flushing, specifically to deal with "wakeup all" work items, as they aren't actually work items, i.e. are never placed in a workqueue. Trying to flush a bogus workqueue entry rightly makes __flush_work() complain (kudos to whoever added that sanity check).
Note, commit 5f6de5cbebee ("KVM: Prevent module exit until al ---truncated---
AnalysisAI
KVM's async page fault workqueue in the Linux kernel contains a deadlock and potential use-after-free condition triggered during vCPU destruction, affecting systems running KVM-based virtualization across multiple stable kernel branches including Debian Linux 10.0. Local users with KVM device access can trigger the flaw by destroying a VM while async page fault work items are in-flight, causing either a permanent kernel worker thread deadlock (confirmed DoS) or a race where the KVM module is unloaded before callbacks complete, risking execution of freed module memory. No active exploitation has been confirmed (absent from CISA KEV, EPSS 0.26% at the 17th percentile) and no public exploit code has been identified, making this a real but low-urgency issue outside of multi-tenant KVM environments.
Technical ContextAI
KVM (Kernel-based Virtual Machine) is the Linux kernel's built-in type-1 hypervisor subsystem, implemented as a loadable kernel module. Async Page Fault (async #PF) is a KVM optimization that defers guest page fault resolution to per-vCPU kernel workqueues rather than blocking the vCPU execution thread. The defect is in kvm_clear_async_pf_completion_queue(), which previously failed to flush the async #PF workqueue on vCPU teardown: async_pf_execute() called kvm_put_kvm() to release its VM reference, but kvm_put_kvm() (after the misguided fix attempt) in turn flushed the very workqueue the callback was currently executing in, creating a circular wait. A second, related bug allowed the KVM module to receive its final module_put() from __fput() while an async workqueue callback was still running, resulting in execution against freed module memory - a use-after-free of kernel text. NVD classifies this as CWE-400 (Uncontrolled Resource Consumption), though the deadlock is more precisely CWE-833 and the module unload race is CWE-416; CWE-400 captures the primary observed outcome of kernel thread starvation. Affected products per CPE: cpe:2.3:o:linux:linux_kernel across multiple stable branches, and cpe:2.3:o:debian:debian_linux:10.0.
RemediationAI
Apply the upstream kernel patch set delivered across nine stable-branch commits referenced by NVD, including https://git.kernel.org/stable/c/3d75b8aa5c29058a512db29da7cbee8052724157, https://git.kernel.org/stable/c/4f3a3bce428fb439c66a578adc447afce7b4a750, https://git.kernel.org/stable/c/82e25cc1c2e93c3023da98be282322fc08b61ffb, https://git.kernel.org/stable/c/83d3c5e309611ef593e2fcb78444fc8ceedf9bac, https://git.kernel.org/stable/c/a75afe480d4349c524d9c659b1a5a544dbc39a98, https://git.kernel.org/stable/c/ab2c2f5d9576112ad22cfd3798071cb74693b1f5, https://git.kernel.org/stable/c/b54478d20375874aeee257744dedfd3e413432ff, https://git.kernel.org/stable/c/caa9af2e27c275e089d702cfbaaece3b42bca31b, and https://git.kernel.org/stable/c/f8730d6335e5f43d09151fca1f0f41922209a264. Debian Linux 10.0 users should apply the relevant Debian Security Advisory updates for the linux package via apt. An exact patched release version is not independently confirmed from the available data - track the stable kernel series changelogs to identify the first tagged release incorporating these commits. As a compensating control where patching is not immediately possible, remove untrusted or semi-trusted users from the 'kvm' group and enforce AppArmor or SELinux policies to restrict /dev/kvm access to authorized virtualization workloads only; this eliminates the untrusted-user attack path but does not prevent the race from occurring under legitimate heavy VM workloads on the unpatched kernel.
More in Debian Linux
View allApache Log4j2 contains a critical JNDI injection vulnerability known as 'Log4Shell' that allows unauthenticated remote c
In PHP versions 7.1.x below 7.1.33, 7.2.x below 7.2.24 and 7.3.x below 7.3.11 in certain configurations of FPM setup it
sapi/cgi/cgi_main.c in PHP before 5.3.12 and 5.4.x before 5.4.2, when configured as a CGI script (aka php-cgi), does not
GNU Bash through 4.3 processes trailing strings after function definitions in the values of environment variables, which
Samba since version 3.5.0 and before 4.6.4, 4.5.10 and 4.4.14 is vulnerable to remote code execution vulnerability, allo
Unspecified vulnerability in the Java Runtime Environment (JRE) component in Oracle Java SE 7 Update 2 and earlier, 6 Up
Roundcube Webmail contains a critical PHP object deserialization vulnerability (CVE-2025-49113, CVSS 9.9) that allows au
RARLAB UnRAR before 6.12 on Linux and UNIX allows directory traversal to write to files during an extract (aka unpack) o
The (1) EPHEMERAL, (2) HTTPS, (3) MVG, (4) MSL, (5) TEXT, (6) SHOW, (7) WIN, and (8) PLT coders in ImageMagick before 6.
When running Apache Tomcat versions 9.0.0.M1 to 9.0.0, 8.5.0 to 8.5.22, 8.0.0.RC1 to 8.0.46 and 7.0.0 to 7.0.81 with HTT
When using the Apache JServ Protocol (AJP), care must be taken when trusting incoming connections to Apache Tomcat. Rate
A remote code execution vulnerability exists within multiple subsystems of Drupal 7.x and 8.x. Rated critical severity (
Same weakness CWE-400 – Uncontrolled Resource Consumption
View allSame technique Denial Of Service
View allShare
External POC / Exploit Code
Leaving vuln.today