CVE-2026-104376: Use-after-free write through dangling object-core list node in Zephyr kernel obj_core
The kernel object core framework (kernel/objcore.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 syssnodet embedded in the object itself. kobjcorelink() appended the object with sysslistappend(), 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 kobjcoreinitandlink() (for example from kseminit()) then wrote a pointer through that stale node. Re-initializing the current tail object also made the list self-referential, so kobjtypewalklocked() / kobjtypewalkunlocked() loop forever.
When CONFIGOBJCORE, CONFIGUSERSPACE and CONFIGDYNAMICOBJECTS are all enabled, an unprivileged user-mode thread can trigger this through system calls alone. It allocates a semaphore with kobjectalloc(), initializes it with kseminit(), and releases it with kobjectrelease(). unrefcheck() then frees the object without unlinking it, and the thread's next kseminit() makes the kernel write a kernel pointer into the freed (and possibly reallocated) kernel heap chunk. In kernel-only builds with CONFIGOBJCORE enabled, the same defect corrupts memory during ordinary operation, because kworkflush() and kworkcancelsync() 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. CONFIGOBJCORE 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.
Affected Software
Remediation
Recommended actions to resolve this vulnerability, in priority order.
- Configuration
Keep CONFIG_OBJ_CORE disabled; the defect affects builds with CONFIG_OBJ_CORE enabled.
Zephyr kernel CONFIG_OBJ_CORE = disabled
Event History
Frequently Asked Questions
Which configurations allow an unprivileged user-mode thread to trigger this issue?
The described syscall-only trigger requires CONFIG_OBJ_CORE, CONFIG_USERSPACE, and CONFIG_DYNAMIC_OBJECTS to all be enabled. Under those conditions, an unprivileged user-mode thread can exercise the affected path without direct kernel-memory access.
What attacker actions are needed to reach the vulnerable state?
The attacker allocates a semaphore with k_object_alloc(), initializes it with k_sem_init(), and releases it with k_object_release(). The release path can free the object without unlinking it from the object-core list; a subsequent k_sem_init() can then cause a kernel pointer write through the stale list node.
Are semaphores the only object type relevant to this issue?
No. The object-core framework links participating kernel objects by type, including semaphores, mutexes, message queues, stacks, pipes, and events. The provided trigger uses dynamically allocated semaphores, but the stale-list condition concerns objects participating in the framework.
Can reinitialization cause a denial of service even without freeing an object?
Yes. Reinitializing the object that is currently the list tail can make the list self-referential. The affected object-type walk functions can then loop indefinitely.