CVE-2026-143091: xen/privcmd: fix double free when an irqfd is shut down twice

Published Dec 3, 2026
·
Updated

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

xen/privcmd: fix double free when an irqfd is shut down twice

irqfddeactivate() takes the irqfd off irqfdslist and queues irqfdshutdown(). queuework() is not a once-only gate: it refuses to enqueue a work item only while WORKSTRUCTPENDING is set, and processonework() clears that bit before it calls the work function. So nothing records that the shutdown work has already been queued, and nothing protects the window between the start of irqfdshutdown() and the kfree() at its end.

Two paths call irqfddeactivate() for the same irqfd:

- privcmdirqfddeassign(), from the PRIVCMDIRQFDFLAGDEASSIGN ioctl;

- irqfdwakeup(), with EPOLLHUP set, when the last reference to the eventfd file goes away, which runs wakeuppoll(&ctx->wqh, EPOLLHUP) from eventfdrelease().

irqfdslock serialises the two calls, but it does not make the second one a no-op, and eventfdctxfdget() takes a reference to the eventfdctx, not to the struct file, so the last fd can still be closed while the ioctl is running:

CPU0 CPU1

eventfdctxfdget() spinlock(irqfdslock) listdelinit(&kirqfd->list) queuework(&kirqfd->shutdown) close(fd) eventfdrelease() wakeuppoll(EPOLLHUP) irqfdwakeup() spinlock(irqfdslock) irqfddeactivate() again

If the work item has already started by then, its pending bit has been cleared and the second queuework() succeeds. irqfdshutdown() then runs twice, so eventfdctxremovewaitqueue(), eventfdctxput() and kfree() each hit the same object a second time; and when the second queuework() lands after the irqfd has been freed, the workqueue list operations write to freed memory.

virt/kvm/eventfd.c has the same two callers and has had this guard since the original irqfd support (721eecbf4fe99): irqfdwakeup() calls irqfddeactivate() only if irqfdisactive(). The comment there explains why that is enough: the other side deactivates the irqfd before it takes it off the waitqueue, and irqfdshutdown() needs the waitqueue lock, which this callback holds, so the irqfd cannot be freed under it.

Do the same here. listdelinit() leaves the list head empty and the irqfd stays off the list until kfree(), so it serves as a one-way "active" flag. The test is in irqfddeactivate() rather than in irqfdwakeup() because privcmdirqfddeassign() walks irqfdslist and can therefore never reach an inactive irqfd; only the wakeup path can, and a single test covers both callers.

Affected Software

1 affected component
Linux Linux kernel

Event History

Dec 3, 2026
CVE Published
via MITRE·09:19 AM
Data Sourced
via MITRE·09:19 AM
Description

Contact

SecAlerts Pty Ltd.
132 Wickham Terrace
Fortitude Valley,
QLD 4006, Australia
info@secalerts.co
By using SecAlerts services, you agree to our services end-user license agreement. This website is safeguarded by reCAPTCHA and governed by the Google Privacy Policy and Terms of Service. All names, logos, and brands of products are owned by their respective owners, and any usage of these names, logos, and brands for identification purposes only does not imply endorsement. If you possess any content that requires removal, please get in touch with us.
© 2026 SecAlerts Pty Ltd.
ABN: 70 645 966 203, ACN: 645 966 203