CVE-2026-143155: vsock/virtio: clear vqs[] to avoid a UAF on a failed PM restore
In the Linux kernel, the following vulnerability has been resolved:
vsock/virtio: clear vqs[] to avoid a UAF on a failed PM restore
virtiovsockvqsdel() frees the virtqueues but leaves vsock->vqs[] pointing at them. If virtiovsockrestore() then fails, the driver stays bound with a dangling vqs[], and the next freeze or unbind passes a freed virtqueue to virtqueuedetachunusedbuf():
BUG: KASAN: slab-use-after-free in virtqueuedetachunusedbuf virtiovsockvqsdel (net/vmwvsock/virtiotransport.c:785) virtiovsockremove Freed by task ...: vpdelvqs virtiovsockfreeze
Clear vqs[] after delvqs() and when virtiofindvqs() fails. Return early from virtiovsockvqsdel() when vqs[] is empty: the detach loops would pass NULL to virtqueuedetachunusedbuf(), and a second delvqs() would free virtio-mmio's IRQ again, which only WARNs in freeirq() ("Trying to free already-free IRQ").
Found with the help of Anthropic's Claude and reproduced on virtio-pci and virtio-mmio by failing the restore with failslab, without other kernel changes; the virtio-mmio WARN was found by the netdev Sashiko review and reproduced with v1 of this patch. With this patch neither report appears on virtio-pci or virtio-mmio guests, and the vsock vmtest.sh single-VM tests pass. A findvqs() failure after some virtqueues were set up was not exercised.
Affected Software
Remediation
Recommended actions to resolve this vulnerability, in priority order.
- Compensating control
Clear virtio_vsock's vqs[] after del_vqs() and when virtio_find_vqs() fails.
Event History
Frequently Asked Questions
Under what conditions can this issue be triggered?
The issue requires a virtio-vsock device to undergo a power-management restore that fails after its virtqueues have been removed. A subsequent freeze or driver unbind can then operate on stale virtqueue pointers.
Which virtio transports were affected in testing?
The failure was reproduced on both virtio-pci and virtio-mmio when restore failure was induced with failslab. On virtio-mmio, repeated queue deletion could also attempt to free an IRQ a second time and produce a warning.
How can administrators identify a potentially affected system?
Affected systems may report a KASAN slab use-after-free in virtqueue_detach_unused_buf during virtio_vsock_vqs_del, virtio_vsock_remove, or a later freeze/unbind operation. Virtio-mmio systems may additionally log a free_irq warning about trying to free an already-free IRQ.
What does the fix change?
The fix clears the stored vqs[] pointers after deleting virtqueues and when virtio_find_vqs() fails. It also avoids repeated queue deletion when vqs[] is empty, preventing both stale-pointer use and repeated IRQ cleanup.