CVE-2026-99853: nvme-tcp: fix io_work priority inversion when send_mutex is held
In the Linux kernel, the following vulnerability has been resolved:
nvme-tcp: fix iowork priority inversion when sendmutex is held
Commit f42d4796ee10 ("nvme-tcp: fix I/O stalls on congested sockets") added a check in nvmetcpiowork() that sets pending to true when the queue has pending requests and the socket is writeable. The check is placed after the mutextrylock() block, so it also runs when mutextrylock(&queue->sendmutex) failed and iowork did not send anything.
When .queuerq sends a request directly from its own context, it holds sendmutex and can give up the CPU in locksocknested() when another task needs the CPU, for example the iowork kworker of the same queue, which runs on the same CPU. Then iowork cannot take sendmutex, but the requests are still on reqlist and the socket is writeable, so pending is set to true. iowork loops until the deadline and queues itself again on iocpu, without sleeping.
This is a priority inversion. iowork runs on the high priority nvmetcpwq and cannot make progress until sendmutex is released, but it keeps running. The task holding sendmutex runs at normal priority and needs the CPU to release it. The scheduler keeps giving the CPU to iowork, so the task holding sendmutex may not run again, and the requests on the queue are not sent and time out.
This is the same problem that commit 70f437fb4395 ("nvme-tcp: fix iowork priority inversion") fixed. That commit removed "pending = !llistempty(&queue->reqlist)" from the path where mutextrylock() fails, and let the task holding sendmutex queue iowork again in nvmetcpqueuerequest() after it releases the mutex. The new check brings back the same behavior in a different form.
Two things make this easier to hit. nvmetcpqueuerequest() sends directly only when it runs on iocpu, so the task that takes sendmutex is on the same CPU as the iowork kworker of that queue when it takes the mutex. Also, when the tasks are in a cgroup with the cpu controller enabled, the whole group competes with the nice -20 kworker as one entity, so each task in the group gets even less CPU time.
We hit this on a 6 CPU VM running a database on nvme-tcp storage. In the vmcore, 2 tasks held sendmutex of 2 queues and were runnable in locksocknested() for 103 seconds, while the kworkers for those queues kept running iowork on their CPUs. All database tasks were in one cgroup, which got only about 0.3% of the CPU against the nice -20 kworker. Requests timed out, and blkmqtimeoutwork() waited in synchronizesrcu() for the tasks still in .queuerq.
Only do the pending check if iowork could take sendmutex. If it could not, the task holding sendmutex sends what it can in nvmetcpsendall(), and queues iowork again after it releases the mutex if requests are still pending, so no request is left behind.
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.12.118 - Upgrade
Upgrade
linux/Kernelto a version that resolves this vulnerability.Fixed in 6.16 - Upgrade
Upgrade
linux/Kernelto a version that resolves this vulnerability.Fixed in 6.18.63 - Upgrade
Upgrade
linux/Kernelto a version that resolves this vulnerability.Fixed in 7.3.4 - Upgrade
Upgrade
debian/linuxto a version that resolves this vulnerability.Fixed in 6.12.118-1 - Upgrade
Upgrade
debian/linuxto a version that resolves this vulnerability.Fixed in 7.3.4-1 - Upgrade
Upgrade
debian/linuxto a version that resolves this vulnerability.Fixed in 6.12.118-1Fixed in 7.3.4-1
Event History
Frequently Asked Questions
Which systems are exposed to this scheduling issue?
Systems using the Linux kernel NVMe over TCP transport are exposed when a queue can send requests directly while holding send_mutex and its io_work kworker runs on the same CPU. The issue depends on pending requests remaining on the queue and the socket being writeable while io_work cannot acquire the mutex.
What is the operational impact when the condition occurs?
The high-priority io_work can repeatedly run and requeue itself without making progress because it cannot obtain send_mutex. This can prevent the normal-priority task holding the mutex from receiving CPU time needed to release it, resulting in a priority inversion and I/O stalls.