CVE-2026-11742: Use-after-free race in kernel `k_queue_peek_head/tail` due to missing spinlock
The kernel queue helper zqueuenodepeek() in kernel/queue.c dereferences a node taken from a queue's dataq list, reading the node's flag byte and, for items enqueued via kqueueallocappend/allocprepend, the data pointer of an internally allocated allocnode struct. The implementations of zimplkqueuepeekhead() and zimplkqueuepeektail() performed this read-and-dereference without holding the queue's spinlock, while every other accessor of the same list — including kqueueget(), which unlinks a node and kfree()s its backing allocnode — operates under that lock.
Because peek was unsynchronized, a concurrent kqueueget() on the same queue (on an SMP build, or under preemption/ISR concurrency) can free the node between the moment peek obtains the node pointer and the moment it dereferences it. The peek then reads flag bits and a data pointer out of freed, potentially re-allocated heap memory and returns a stale or dangling pointer to its caller. kfifo and klifo are thin wrappers over kqueue, so this affects buffer queues used throughout the netbuf, Bluetooth, USB, and networking subsystems; the peek operations are also system calls reachable from CONFIGUSERSPACE threads.
The consequences are a use-after-free read that can leak stale heap contents (one pointer word) and, when the returned dangling pointer is subsequently consumed as a live buffer, a dereference that can crash the system or corrupt memory. Exploitation requires winning a small race window with local access (e.g. a userspace process racing kqueuepeek against kqueueget on a shared queue, or two CPUs), so practical impact is bounded and of low severity.
The fix wraps both peek implementations with kspinlock/kspinunlock on the queue lock, making the read-and-dereference atomic with respect to the concurrent unlink-and-free and bringing peek into line with the rest of the queue's locking discipline.
Affected Software
Remediation
Recommended actions to resolve this vulnerability, in priority order.
- Configuration
Update implementations of z_impl_k_queue_peek_head() and z_impl_k_queue_peek_tail() to wrap the node pointer read and subsequent dereference with the queue's spinlock using k_spin_lock/k_spin_unlock, so the read-and-dereference is atomic with respect to concurrent unlink-and-free (k_queue_get() unlinks and k_free()s the alloc_node under the same lock).
Zephyr kernel queue helper (k_queue_peek_head/tail) Queue spinlock protection around peek read-and-dereference = Acquire queue lock before dereferencing node returned by peek and release after read (wrap both peek implementations with k_spin_lock/k_spin_unlock on the queue lock)
Event History
Frequently Asked Questions
What is the severity of CVE-2026-11742?
The severity of CVE-2026-11742 is classified as low with a score of 3.6.
What risk level is associated with CVE-2026-11742?
CVE-2026-11742 has a risk level of 25.
How does CVE-2026-11742 affect the Linux Kernel?
CVE-2026-11742 involves a use-after-free condition in the kernel queue helper that can lead to potential memory corruption.
How can I mitigate CVE-2026-11742?
Mitigation for CVE-2026-11742 involves applying patches provided by the Linux Kernel maintainers.
What is the cause of CVE-2026-11742?
CVE-2026-11742 is caused by a missing spinlock in the `k_queue_peek_head/tail` functions, leading to race conditions.