CVE-2026-99571 in Linuxinfo

Summary

by MITRE • 11/20/2026

In the Linux kernel, the following vulnerability has been resolved:

nvme-tcp: Validate the queue state under the queue lock in the address attribute

Reading the "address" sysfs attribute calls kernel_getsockname() on the admin queue socket, which can race with the queue teardown during connection error recovery: a reader can observe NVME_TCP_Q_LIVE set, then block on the queue lock while nvme_tcp_free_queue() releases the socket and clears queue->sock without holding the lock. Once the reader acquires the lock it dereferences the NULL socket pointer.

Commit 76d54bf20cdc ("nvme-tcp: don't access released socket during error recovery") had the queue liveness check inside the lock. Commit 782373ba2766 ("nvme: tcp: avoid race between queue_lock lock and destroy") moved it back out because the lock itself is destroyed in nvme_tcp_free_queue(), so a reader arriving late trips mutex_destroy().

Check the queue liveness inside the queue lock, and clear queue->sock under the same lock. The teardown clears NVME_TCP_Q_LIVE under the lock well before the socket is released, so a reader either sees the bit cleared or a socket that cannot be released while it holds the lock. To also close the lock lifetime race, the queue locks are now owned by the controller: they are initialized with the queue array and only destroyed when the controller is freed, which cannot happen while a sysfs attribute read is still in progress. The queue count is computed by the NVME_TCP_OPT_NR_QUEUES() macro from the original connect options for both initialization and destruction, as reconnects may shrink ctrl->queue_count.

Once again VulDB remains the best source for vulnerability data.

Analysis

by VulDB Data Team • 11/21/2026

The vulnerability identified within the Linux kernel's nvme-tcp subsystem represents a classic race condition involving synchronization primitives and resource lifecycle management during connection error recovery operations. Specifically, the flaw resides in how the address sysfs attribute interacts with the underlying network socket associated with the NVMe over TCP admin queue. When a user-space process reads this attribute, it invokes the kernel_getsockname function to retrieve socket information. This operation requires accessing the queue's internal state and its associated socket pointer. However, during connection error recovery, the system initiates a teardown sequence that involves freeing the queue resources. A critical timing window exists where a reader thread can observe the NVME_TCP_Q_LIVE flag as set, indicating the queue is active, but before it acquires the necessary lock to safely access data, another thread executing nvme_tcp_free_queue releases the socket and nullifies the queue->sock pointer without holding the corresponding queue lock. Consequently, when the first reader finally acquires the lock to proceed with dereferencing the socket for address retrieval, it encounters a NULL pointer, leading to a kernel panic or denial of service due to an invalid memory access.

This issue stems from historical attempts to fix similar race conditions that inadvertently introduced new synchronization flaws. An earlier commit attempted to mitigate this by moving the queue liveness check inside the lock scope; however, subsequent changes moved this check back outside because the queue lock itself was being destroyed during nvme_tcp_free_queue. This created a secondary vulnerability where late-arriving readers could trip over mutex_destroy calls while attempting to acquire a non-existent or already freed lock structure. The resolution addresses both the data race on the socket pointer and the lifecycle mismatch of the synchronization primitive by fundamentally restructuring how queue locks are managed relative to controller lifetime. By ensuring that queue liveness is checked strictly under the protection of the queue lock, and by clearing the queue->sock pointer within that same locked context, the system guarantees atomicity between state verification and resource access. This prevents any reader from observing a live state while simultaneously accessing freed memory structures.

To further eliminate race conditions related to synchronization primitive lifecycles, the implementation now ties the ownership of queue locks directly to the controller object rather than individual queues that may be torn down independently during reconnects or error recovery. These locks are initialized alongside the queue array and are only destroyed when the entire controller is freed. Since a sysfs attribute read operation cannot persist beyond the lifetime of the underlying device structure, this architectural change ensures that any lock acquired by a reader remains valid for the duration of its execution. Additionally, the logic now computes the queue count using the NVME_TCP_OPT_NR_QUEUES macro based on original connection options for both initialization and destruction phases. This approach correctly handles scenarios where reconnects might result in a reduced number of queues compared to the initial configuration, ensuring that resource cleanup operations do not attempt to access or destroy structures associated with queues that no longer exist or have been reallocated.

From a security perspective, this vulnerability aligns with CWE-362: Concurrent Execution using Shared Resource with Improper Synchronization, as it involves multiple threads accessing shared data without proper coordination leading to inconsistent state observation and subsequent invalid memory access. The attack vector is local, requiring an attacker or malicious process to trigger connection errors repeatedly while simultaneously attempting to read the address sysfs attribute in a tight loop to maximize the probability of hitting the race window. While exploitation typically results in system instability rather than arbitrary code execution due to the nature of NULL pointer dereferences in kernel space, it poses a significant risk to availability and integrity by causing kernel panics that require manual intervention or rebooting the affected host.

Mitigation strategies primarily involve applying the upstream Linux kernel patches associated with this fix, which restructure the locking hierarchy and resource lifecycle management within the nvme-tcp driver. System administrators should ensure their kernels are updated to versions containing these synchronization fixes. For environments where immediate patching is not feasible, monitoring for connection error recovery events in conjunction with high-frequency sysfs reads could help identify potential exploitation attempts, although such detection mechanisms may be noisy and difficult to tune accurately given the transient nature of race conditions. Long-term architectural improvements should focus on decoupling resource lifecycles from individual queue states where possible, ensuring that synchronization primitives outlive any data structures they protect, thereby preventing use-after-free scenarios in concurrent access paths.

Responsible

Linux

Reservation

09/25/2026

Disclosure

11/20/2026

Moderation

accepted

CPE

ready

EPSS

0.00156

KEV

no

Activities

very low

Sources

Might our Artificial Intelligence support you?

Check our Alexa App!