CVE-2026-143330: vhost-vdpa: drop the parent's vq callback before the call fd is released
In the Linux kernel, the following vulnerability has been resolved:
vhost-vdpa: drop the parent's vq callback before the call fd is released
VHOSTSETVRINGCALL releases the previous call eventfd inside vhostvringioctl() -- it swaps the new context into vq->callctx.ctx and then eventfdctxput()s the old one, which is a synchronous kfree(). The parent vdpa device is only told about the change afterwards, when vhostvdpavringioctl() reaches ops->setvqcb().
Parent drivers cache the pointer handed to them in vdpacallback::trigger and do not take a reference on it, so throughout that window the parent holds a dangling eventfdctx and may signal it. The documentation added with the field describes what signalling it means but says nothing about how long it stays valid.
This is the same hazard that "vhostvdpa: assign irq bypass producer token correctly" addressed for the irq bypass producer token, by moving vhostvdpaunsetupvqirq() ahead of the vhostvringioctl() call. The producer token was only one of the two consumers of that pointer; the one the parent keeps via ->setvqcb() was left behind the free.
With VDUSE the window is directly reachable from userspace, because the device emulation daemon can inject an interrupt at any time from a different fd, and neither side shares a lock with the other: VDUSE takes vq->irqlock, vhost takes vhostdev.mutex + vq->mutex.
BUG: KASAN: slab-use-after-free in rawspinlockirqsave+0x76/0xe0 Write of size 4 at addr ffff8881084e8788 by task vduseuaf/2987
rawspinlockirqsave+0x76/0xe0 eventfdsignalmask+0x69/0x120 vdusedevioctl+0x337/0x1a60 <- vdusevqsignalirqfd(), inlined x64sysioctl+0x120/0x170 <- VDUSEVQINJECTIRQ
Allocated by task 2986: doeventfd+0x50/0x200 x64syseventfd2+0x2e/0x40
kmalloc-64, freed 64-byte region [ffff8881084e8780, ffff8881084e87c0)
One thread loops VHOSTSETVRINGCALL on /dev/vhost-vdpa-N with a fresh eventfd and then unbinds it, while another loops VDUSEVQINJECTIRQ on /dev/vduse/<name>. This reproduces in 5 out of 5 ten-second runs on v7.1.6 and 3 out of 3 on v7.2-rc6. With the patch there are no reports in 3 out of 3 runs on either, while the same workload still gets ~30000 interrupts per run delivered into live eventfds, so the path is still being exercised.
Tell the parent to drop the callback before vhostvringioctl() can free the eventfd, mirroring what is already done for the bypass producer, and restore it if the ioctl fails -- on failure the swap never happened, the old context is still installed, and leaving the parent without a callback would silently drop that vq's interrupts.
Clearing the callback only stops a parent from starting to use the context; a handler that already loaded it can still be running. For parents with a real interrupt, wait for it with synchronizeirq() on the vq's irq. VDUSE does not implement getvqirq, so that case stays covered by the teardown above.
Affected Software
Remediation
Recommended actions to resolve this vulnerability, in priority order.
- Upgrade
Upgrade
linux/Kernelto a version that resolves this vulnerability.Fixed in 5.11 - Upgrade
Upgrade
linux/Kernelto a version that resolves this vulnerability.Fixed in 5.16 - Upgrade
Upgrade
linux/Kernelto a version that resolves this vulnerability.Fixed in 6.2 - Upgrade
Upgrade
linux/Kernelto a version that resolves this vulnerability.Fixed in 6.12.120 - Upgrade
Upgrade
linux/Kernelto a version that resolves this vulnerability.Fixed in 6.18.66 - Upgrade
Upgrade
linux/Kernelto a version that resolves this vulnerability.Fixed in 7.3.7 - Compensating control
In vhost-vdpa, call vhost_vdpa_unsetup_vq_irq() before vhost_vring_ioctl() releases the old call eventfd. Clear the parent’s vq callback before releasing it, wait with synchronize_irq() for parents with a real interrupt, and restore the callback if the ioctl fails.
Event History
Frequently Asked Questions
Which environments are most directly exposed?
VDUSE environments are directly reachable from userspace. The issue also concerns vDPA parent drivers that cache the callback trigger pointer supplied through set_vq_cb without taking their own reference.
What operation creates the unsafe window?
Replacing a virtqueue call eventfd through VHOST_SET_VRING_CALL swaps in the new context and synchronously frees the old eventfd context before the parent device is notified of the callback change. If the parent signals its cached callback during that interval, it can use a dangling eventfd context.