CVE-2026-85035
Awaiting Analysis Awaiting Analysis - Queue

Use-After-Free in Zephyr RTOS CAN Driver

Vulnerability report for CVE-2026-85035, including description, CVSS score, EPSS score, affected products, exploitability, helpful resources, and attack-flow context.

Publication date: 2026-11-03

Last updated on: 2026-11-03

Assigner: Zephyr Project

Description

The can_add_rx_filter_msgq() system call installs a CAN RX filter whose callback (can_msgq_put() in drivers/can/can_common.c) is handed the caller's struct k_msgq * as user_data. The controller driver stores that raw pointer in its filter table and dereferences it from the RX path every time a matching frame arrives. The system call verifier z_vrfy_can_add_rx_filter_msgq() in drivers/can/can_handlers.c validated the queue only with K_SYSCALL_OBJ(), which is a point-in-time check of type, initialization and caller permission and says nothing about the object's lifetime. On a build with CONFIG_USERSPACE=y and CONFIG_DYNAMIC_OBJECTS=y, an unprivileged user-mode thread that has been granted access to a CAN device can obtain a message queue whose lifetime it fully controls: k_object_alloc(K_OBJ_MSGQ) followed by k_msgq_alloc_init(). The lifetime of such an object is driven solely by its permission bitmask, and a pointer retained by the kernel is not represented there. After registering the filter, the thread calls k_object_release() β€” or simply terminates β€” and unref_check() frees the struct k_msgq storage while the CAN driver still holds the pointer. The next matching CAN frame causes k_msgq_put() to run in supervisor context against freed memory that the attacker can have groomed with another kernel allocation: the frame payload is memcpy()d through the reused block's write_ptr, and the queue's wait_q (and poll_events under CONFIG_POLL) list nodes are manipulated. This yields kernel-heap corruption reachable from a user-mode thread, defeating the isolation CONFIG_USERSPACE is intended to provide; the same dangling pointer also arises benignly when an application thread exits without calling can_remove_rx_filter(). The fix validates the queue with K_SYSCALL_OBJ_STATIC(), which additionally rejects objects carrying K_OBJ_FLAG_ALLOC, so only statically defined queues (CAN_MSGQ_DEFINE()) may be registered from user mode. Supervisor-mode callers bypass the verifier and must themselves keep the queue valid until the filter is removed.

CVSS Scores

EPSS Scores

Probability:
Percentile:

Meta Information

Published
2026-11-03
Last Modified
2026-11-03
Generated
2026-11-03
AI Q&A
2026-11-03
EPSS Evaluated
N/A
NVD
EUVD

Affected Vendors & Products

Showing 2 associated CPEs
Vendor Product Version / Range
zephyrproject zephyr 1.14.0
zephyrproject zephyr 4.4.0

Helpful Resources

Exploitability

CWE
CWE Icon
KEV
KEV Icon
CWE ID Description
CWE-416 The product reuses or references memory after it has been freed. At some point afterward, the memory may be allocated again and saved in another pointer, while the original pointer references a location somewhere within the new allocation. Any operations using the original pointer are no longer valid because the memory "belongs" to the code that operates on the new pointer.

Attack-Flow Graph

AI Quick Actions

Instant insights powered by AI
Executive Summary

CVE-2026-85035 is a use-after-free vulnerability in the Zephyr RTOS CAN driver. It occurs when the can_add_rx_filter_msgq() function registers a CAN RX filter with a message queue pointer. The kernel verifier only checks the queue's validity at registration but not its lifetime. An unprivileged user thread can free the queue while the CAN driver retains the dangling pointer. When the freed memory is reused, a matching CAN frame triggers the stale filter, delivering frames into a supervisor-owned queue, bypassing privilege boundaries.

The fix validates the queue using K_SYSCALL_OBJ_STATIC(), restricting user-mode registration to statically defined queues only. Supervisor-mode callers must maintain queue validity manually.

Detection Guidance

Detecting this vulnerability requires checking Zephyr RTOS versions and CAN driver configurations. Use 'west build -t print-versions' to verify Zephyr version. Check if CONFIG_USERSPACE and CONFIG_DYNAMIC_OBJECTS are enabled in your kernel config. Inspect CAN driver code for use of can_add_rx_filter_msgq() with dynamically allocated message queues.

Impact Analysis

This vulnerability allows an unprivileged user-mode thread to exploit a stale pointer to deliver CAN frames into a supervisor-owned message queue. This can lead to kernel-heap corruption, privilege escalation, and bypassing intended isolation provided by CONFIG_USERSPACE. Attackers can groom freed memory to manipulate queue structures, enabling arbitrary code execution in supervisor context.

Mitigation Strategies

Upgrade Zephyr RTOS to version 4.3.2 or later, or 4.5.0 or later if using 4.4.x. Ensure only statically defined message queues (CAN_MSGQ_DEFINE) are used with can_add_rx_filter_msgq(). Disable CONFIG_DYNAMIC_OBJECTS if not required. Review CAN driver configurations to confirm no dynamic queue allocations are present.

Chat Assistant

Ask questions about this CVE
Hi! I’m here to help you understand CVE-2026-85035. Ask me anything about the vulnerability, its impact, or mitigation strategies.
0/70

EPSS Chart

Security Radar

News mentioning this vulnerability
Loading related security news...