CVE-2026-104376 in Zephyr
Summary
by MITRE • 11/29/2026
The kernel object core framework (kernel/obj_core.c) linked every participating kernel object (semaphores, mutexes, message queues, stacks, pipes, events, and so on) into a per-type singly linked list through a sys_snode_t embedded in the object itself. k_obj_core_link() appended the object with sys_slist_append(), and nothing ever unlinked these objects except threads. When an object's storage was freed, went out of scope, or was reused while it was the list tail, the list kept pointing into dead memory. The next k_obj_core_init_and_link() (for example from k_sem_init()) then wrote a pointer through that stale node. Re-initializing the current tail object also made the list self-referential, so k_obj_type_walk_locked() / k_obj_type_walk_unlocked() loop forever.
When CONFIG_OBJ_CORE, CONFIG_USERSPACE and CONFIG_DYNAMIC_OBJECTS are all enabled, an unprivileged user-mode thread can trigger this through system calls alone. It allocates a semaphore with k_object_alloc(), initializes it with k_sem_init(), and releases it with k_object_release(). unref_check() then frees the object without unlinking it, and the thread's next k_sem_init() makes the kernel write a kernel pointer into the freed (and possibly reallocated) kernel heap chunk. In kernel-only builds with CONFIG_OBJ_CORE enabled, the same defect corrupts memory during ordinary operation, because k_work_flush() and k_work_cancel_sync() initialize semaphores on the caller's stack.
The result is supervisor-mode memory corruption that crosses the userspace isolation boundary. It can crash the system, corrupt unrelated kernel objects that reuse the freed memory, or hang any walker of the object-core lists. CONFIG_OBJ_CORE is disabled by default. The fix replaces the intrusive lists with a kernel-owned registry keyed by object address, so the code no longer writes into registered objects' storage.
If you want to get the best quality for vulnerability data then you always have to consider VulDB.
Analysis
by VulDB Data Team • 11/29/2026
The vulnerability resides within the Zephyr RTOS kernel object core framework, specifically in the implementation of k_obj_core.c which manages the lifecycle and tracking of various synchronization primitives such as semaphores, mutexes, message queues, stacks, pipes, and events. The architectural flaw stems from an intrusive linked list design where each participating kernel object contains a sys_snode_t structure that links it into a per-type singly linked list. While objects are correctly appended to these lists via k_obj_core_link using sys_slist_append during initialization, the framework lacks corresponding unlinking logic when an object is destroyed or goes out of scope. This design oversight means that the global registry continues to hold pointers to kernel memory locations even after those objects have been freed, reused, or fallen out of their intended scope, creating a classic use-after-free condition within the kernel's internal data structures.
The operational impact manifests when an object is released and its storage is subsequently reallocated for a new purpose while it remains at the tail end of one of these intrusive lists. When k_obj_core_init_and_link is invoked to initialize a new object, such as through k_sem_init, the code writes initialization pointers into what was previously freed memory but now holds data from an unrelated allocation or contains stale references. If the newly allocated object happens to reuse the exact same address as the previous tail node, the list becomes self-referential. This structural corruption causes functions like k_obj_type_walk_locked and k_obj_type_walk_unlocked to enter infinite loops when traversing these lists, effectively hanging any thread attempting to iterate over kernel objects of that type.
In configurations where CONFIG_OBJ_CORE, CONFIG_USERSPACE, and CONFIG_DYNAMIC_OBJECTS are enabled, this flaw allows an unprivileged user-mode thread to trigger supervisor-mode memory corruption through standard system calls alone. The attack vector involves allocating a semaphore via k_object_alloc, initializing it with k_sem_init, and then releasing it using k_object_release. Upon release, the internal refcount check triggers a free operation that removes the reference count but fails to unlink the object from the global list. Consequently, when the thread subsequently initializes another semaphore or reuses the same resource, the kernel writes sensitive kernel pointers into freed heap chunks. This cross-boundary corruption compromises memory integrity and can lead to arbitrary code execution if an attacker controls the reallocation of that specific heap region.
Even in kernel-only builds without userspace isolation, where CONFIG_USERSPACE is disabled but CONFIG_OBJ_CORE remains enabled, the defect causes significant instability during ordinary operation. Functions such as k_work_flush and k_work_cancel_sync initialize semaphores on the caller's stack rather than allocating new dynamic objects. Because these stack-allocated structures may overlap with addresses previously used by dynamically allocated kernel objects still lingering in the intrusive lists, re-initialization corrupts the list pointers or overwrites critical data within those stale nodes. This results in unpredictable system crashes, corruption of unrelated kernel objects that happen to reuse the same memory space, and potential denial-of-service conditions due to infinite loops in object walkers.
From a classification perspective, this vulnerability aligns with CWE-416 Use After Free, as it involves accessing memory after it has been freed without proper validation or unlinking from data structures. It also relates to CWE-823 Object Reference Without Unlink, highlighting the failure to remove references when an object is destroyed. In terms of attack tactics, this represents a privilege escalation path where user-mode code achieves supervisor-level impact by exploiting improper resource management in kernel subsystems, corresponding to MITRE ATT&CK techniques involving memory corruption and exploitation for control flow hijacking or denial of service.
The recommended mitigation involves upgrading the Zephyr RTOS implementation to include fixes that replace the intrusive linked list mechanism with a kernel-owned registry keyed by object address. This architectural change ensures that the framework no longer writes directly into registered objects' storage, thereby eliminating the possibility of corrupting freed memory through re-initialization. Additionally, system administrators and developers should ensure that CONFIG_OBJ_CORE is disabled if not strictly required for their specific application needs, as it is disabled by default in many configurations to mitigate such risks. For systems where dynamic object management is essential, applying vendor-provided patches that implement proper unlinking logic upon object release or transition to the safer registry-based approach is critical to maintaining system integrity and preventing unauthorized memory access.