CVE-2026-11742

Use-after-free race in kernel `k_queue_peek_head/tail` due to missing spinlock

Published Aug 7, 2026 CVSS 3.1 · 3.6 Low EPSS < 1% KEV · Not listed
Description
The kernel queue helper z_queue_node_peek() in kernel/queue.c dereferences a node taken from a queue's data_q list, reading the node's flag byte and, for items enqueued via k_queue_alloc_append/alloc_prepend, the data pointer of an internally allocated alloc_node struct. The implementations of z_impl_k_queue_peek_head() and z_impl_k_queue_peek_tail() performed this read-and-dereference without holding the queue's spinlock, while every other accessor of the same list — including k_queue_get(), which unlinks a node and k_free()s its backing alloc_node — operates under that lock.

Because peek was unsynchronized, a concurrent k_queue_get() 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. k_fifo and k_lifo are thin wrappers over k_queue, so this affects buffer queues used throughout the net_buf, Bluetooth, USB, and networking subsystems; the peek operations are also system calls reachable from CONFIG_USERSPACE 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 k_queue_peek_* against k_queue_get on a shared queue, or two CPUs), so practical impact is bounded and of low severity.

The fix wraps both peek implementations with k_spin_lock/k_spin_unlock 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.

Analysis

AI-generated

Technical impact

The Zephyr kernel queue helper z_queue_node_peek() is unsynchronized, allowing a race between a peek operation and an unlink/free in k_queue_get(), resulting in a use‑after‑free read that can leak a stale heap pointer and cause crashes or memory corruption when that pointer is later dereferenced. The issue affects k_queue, k_fifo, and k_lifo, which are used in networking, Bluetooth, USB, and other subsystems, and the peek operations are exposed to CONFIG_USERSPACE threads.

Affected Systems

Zephyr RTOS kernel queues (k_queue, k_fifo, k_lifo) used throughout net_buf, Bluetooth, USB, and networking subsystems; applies to all Zephyr releases before the fix at commit a6b6149a50cb0f64061869f7536acbf80ccc5e0c.

Risk and Exploitability

The vulnerability has a CVSS score of 3.6 (low severity) and an unavailable EPSS score, and is not listed in CISA KEV. Exploitation requires a small race window with local or userspace access, such as a process racing k_queue_peek_* against k_queue_get on a shared queue or across CPUs. Because the attack is local and race‑based, the practical impact is confined and considered low, but an attacker could force a crash or memory corruption on the affected system.

Remediation

No solution or workaround provided in the CVE record.

OpenCVE Recommended Actions

  • Upgrade to a Zephyr branch that includes the fix (commit a6b6149 or newer).
  • Rebuild the kernel with the updated source to ensure the spinlock protection is compiled in.
  • If unable to upgrade immediately, restrict or disable shared queue usage in critical sections or reduce concurrent access to mitigate the race condition until a patch is applied.

Generated by OpenCVE AI on August 7, 2026 at 22:22 UTC.

Tracking

Sign in to view the affected projects.

Advisories

No advisories available
History
Type Values Removed Values Added
Metrics ssvc

{'options': {'Automatable': 'no', 'Exploitation': 'none', 'Technical Impact': 'partial'}, 'version': '2.0.3'}

Type Values Removed Values Added
First Time appeared Zephyrproject
Zephyrproject zephyr
Vendors & Products Zephyrproject
Zephyrproject zephyr
Type Values Removed Values Added
Description The kernel queue helper z_queue_node_peek() in kernel/queue.c dereferences a node taken from a queue's data_q list, reading the node's flag byte and, for items enqueued via k_queue_alloc_append/alloc_prepend, the data pointer of an internally allocated alloc_node struct. The implementations of z_impl_k_queue_peek_head() and z_impl_k_queue_peek_tail() performed this read-and-dereference without holding the queue's spinlock, while every other accessor of the same list — including k_queue_get(), which unlinks a node and k_free()s its backing alloc_node — operates under that lock. Because peek was unsynchronized, a concurrent k_queue_get() 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. k_fifo and k_lifo are thin wrappers over k_queue, so this affects buffer queues used throughout the net_buf, Bluetooth, USB, and networking subsystems; the peek operations are also system calls reachable from CONFIG_USERSPACE 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 k_queue_peek_* against k_queue_get on a shared queue, or two CPUs), so practical impact is bounded and of low severity. The fix wraps both peek implementations with k_spin_lock/k_spin_unlock 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.
Title Use-after-free race in kernel `k_queue_peek_head/tail` due to missing spinlock
Weaknesses CWE-416
References
Metrics cvssV3_1

{'score': 3.6, 'vector': 'CVSS:3.1/AV:L/AC:H/PR:L/UI:N/S:U/C:L/I:N/A:L'}

Weaknesses

Sources

Status
PUBLISHED
Assigner
zephyr
Published
Updated
Nov 4, 2026, 4:59 AM
Reserved
Jun 9, 2026, 5:26 AM
Status
Awaiting Analysis
Published
Aug 7, 2026, 10:16 PM
Modified
Nov 4, 2026, 5:18 AM