Executive brief
The Linux kernel's SMB Direct protocol handler contains a use-after-free vulnerability in its completion queue cleanup code. When tearing down network connections, freed completion queues can be accessed by pending asynchronous work, leading to memory corruption and kernel crashes. An attacker with network access to trigger SMB Direct connections could exploit this to cause denial of service or potentially gain code execution.
Technical details
The vulnerability is a use-after-free in the smbdirect subsystem's queue pair destruction code. The function smbdirect_connection_destroy_qp() creates send and receive completion queues using ib_alloc_cq_any() with IB_POLL_WORKQUEUE mode, which registers an internal completion handler (ib_cq_poll_work) on a workqueue. However, teardown uses ib_destroy_cq() instead of ib_free_cq(), which frees the CQ structure without cancelling the poll work handler. If a completion arrives after the CQ is freed—particularly from Soft-RoCE (rxe) posting late RNR errors—the handler attempts to re-queue work on the already-freed CQ, causing a use-after-free fault. The fix replaces ib_destroy_cq() with ib_free_cq(), which properly synchronizes and cancels the poll work before freeing the queue structure. Network reachability to trigger SMB Direct connections is the primary attack precondition.
Affected products
- Linux Linux kernel 7.2.0 (and likely earlier versions with smbdirect support)
Timeline
- 2026-09-17: disclosed
- 2026: patched: Fix applied in kernel commit resolving smbdirect completion queue teardown