CVE-2026-99596: nvme: wait for SRCU readers before splicing the namespace list
In the Linux kernel, the following vulnerability has been resolved:
nvme: wait for SRCU readers before splicing the namespace list
Readers walk ctrl->namespaces under ctrl->srcu, and some of them sleep there, e.g. nvmewaitfreeze() waiting for I/O to drain.
nvmeremovenamespaces() moves the list onto its on-stack nslist with listspliceinitrcu(), which only waits for RCU readers before relinking the entries. A reader still on the last namespace then follows its next pointer to nslist instead of ctrl->namespaces and treats the stack as a namespace. Deleting a controller while a Format NVM passthrough waits for a delayed read on the last namespace gives:
BUG: KASAN: stack-out-of-bounds in nvmewaitfreeze+0x102/0x120 Read of size 8 at addr ff110001d2f3fc38 by task nvme/4413 Call Trace: nvmewaitfreeze nvmepassthrustart nvmesubmitusercmd nvmeusercmd nvmedevioctl BUG: unable to handle page fault for address: ffffffff8af04850
Use listspliceinitsrcu() instead, which waits for the SRCU readers. This also takes the RCU grace period out of every controller deletion. Deleting 64 tcp controllers with one namespace each, median of 3 runs on each of two boots per kernel:
before after nvme disconnect-all (ms) 3491 / 3509 2996 / 3165 nvmeremovenamespaces() avg (ms) 39.0 / 40.5 31.9 / 34.7
Affected Software
Remediation
Recommended actions to resolve this vulnerability, in priority order.
- Upgrade
Upgrade
linux/Kernelto a version that resolves this vulnerability.Fixed in 6.7 - Upgrade
Upgrade
linux/Kernelto a version that resolves this vulnerability.Fixed in 6.12.118 - Upgrade
Upgrade
linux/Kernelto a version that resolves this vulnerability.Fixed in 6.18.64 - Upgrade
Upgrade
linux/Kernelto a version that resolves this vulnerability.Fixed in 7.3.5 - Compensating control
In nvme_remove_namespaces(), use list_splice_init_srcu() instead of list_splice_init_rcu() when moving the namespace list, so the operation waits for SRCU readers.
Event History
Frequently Asked Questions
What activity is required to trigger this issue?
A controller must be deleted while an SRCU-protected namespace reader is still active. The described trigger is a Format NVM passthrough operation waiting for delayed I/O on the last namespace while the controller is removed.
What is the likely impact if the race occurs?
A reader can follow a namespace list pointer into an on-stack temporary list and interpret stack memory as a namespace. The reported results include a KASAN stack-out-of-bounds read and an invalid-address page fault.
How can I tell whether a system has encountered this issue?
Look for kernel reports during NVMe controller removal containing KASAN stack-out-of-bounds errors in nvme_wait_freeze, or page faults associated with nvme_passthru_start, nvme_submit_user_cmd, nvme_user_cmd, or nvme_dev_ioctl.
What change fixes the race?
The fix replaces list_splice_init_rcu() with list_splice_init_srcu() when removing namespaces, so namespace-list relinking waits for SRCU readers to finish.