The user-mode verifier for the I2S configure system call, z_vrfy_i2s_configure() in drivers/i2s/i2s_handlers.c, validated the caller-supplied struct k_mem_slab * with K_SYSCALL_OBJ(). That is a point-in-time check: it confirms the object type, that the object is initialized, and that the calling thread holds permission on it, but it places no hold on the object's lifetime. The validated pointer is then copied into the driver's per-direction stream state (for example drv_data->rx.cfg.mem_slab in drivers/i2s/i2s_nrfx.c) and is dereferenced long after the system call returns.
The lifetime of a kernel object allocated with k_object_alloc() is driven solely by its permission bitmask; a pointer retained by the kernel is not represented there. A user thread that holds the last permission on such a slab can free it at any time after the check, either by calling k_object_release() or simply by terminating, at which point unref_check() in kernel/userspace/userspace.c releases both the object metadata and the struct k_mem_slab storage back to the kernel heap. The subsequent i2s_buf_write(), i2s_buf_read(), or driver DMA/ISR completion then calls k_mem_slab_alloc() / k_mem_slab_free() through the stale pointer.
The result is a supervisor-mode use-after-free reachable from an unprivileged user thread: the freed block is read and written (free_list, wait queue, info.num_used) after the attacker can have caused it to be reused by an unrelated kernel object, which undermines the isolation that CONFIG_USERSPACE is meant to provide. Exploitation requires CONFIG_USERSPACE together with CONFIG_DYNAMIC_OBJECTS, and an application that hands a dynamically allocated, initialized memory slab to a user thread that becomes its last permission holder — k_mem_slab_init() is not itself a system call, so a user thread cannot create such a slab unaided. Builds that use only statically declared slabs (K_MEM_SLAB_DEFINE) are unaffected.
The fix replaces the check with K_SYSCALL_OBJ_STATIC(), which additionally rejects objects carrying K_OBJ_FLAG_ALLOC, so only slabs that can never be freed reach the driver.
The lifetime of a kernel object allocated with k_object_alloc() is driven solely by its permission bitmask; a pointer retained by the kernel is not represented there. A user thread that holds the last permission on such a slab can free it at any time after the check, either by calling k_object_release() or simply by terminating, at which point unref_check() in kernel/userspace/userspace.c releases both the object metadata and the struct k_mem_slab storage back to the kernel heap. The subsequent i2s_buf_write(), i2s_buf_read(), or driver DMA/ISR completion then calls k_mem_slab_alloc() / k_mem_slab_free() through the stale pointer.
The result is a supervisor-mode use-after-free reachable from an unprivileged user thread: the freed block is read and written (free_list, wait queue, info.num_used) after the attacker can have caused it to be reused by an unrelated kernel object, which undermines the isolation that CONFIG_USERSPACE is meant to provide. Exploitation requires CONFIG_USERSPACE together with CONFIG_DYNAMIC_OBJECTS, and an application that hands a dynamically allocated, initialized memory slab to a user thread that becomes its last permission holder — k_mem_slab_init() is not itself a system call, so a user thread cannot create such a slab unaided. Builds that use only statically declared slabs (K_MEM_SLAB_DEFINE) are unaffected.
The fix replaces the check with K_SYSCALL_OBJ_STATIC(), which additionally rejects objects carrying K_OBJ_FLAG_ALLOC, so only slabs that can never be freed reach the driver.
Project Subscriptions
No data.
Advisories
No advisories yet.
Fixes
Solution
No solution given by the vendor.
Workaround
No workaround given by the vendor.
References
History
Thu, 03 Dec 2026 19:45:00 +0000
| Type | Values Removed | Values Added |
|---|---|---|
| Description | The user-mode verifier for the I2S configure system call, z_vrfy_i2s_configure() in drivers/i2s/i2s_handlers.c, validated the caller-supplied struct k_mem_slab * with K_SYSCALL_OBJ(). That is a point-in-time check: it confirms the object type, that the object is initialized, and that the calling thread holds permission on it, but it places no hold on the object's lifetime. The validated pointer is then copied into the driver's per-direction stream state (for example drv_data->rx.cfg.mem_slab in drivers/i2s/i2s_nrfx.c) and is dereferenced long after the system call returns. The lifetime of a kernel object allocated with k_object_alloc() is driven solely by its permission bitmask; a pointer retained by the kernel is not represented there. A user thread that holds the last permission on such a slab can free it at any time after the check, either by calling k_object_release() or simply by terminating, at which point unref_check() in kernel/userspace/userspace.c releases both the object metadata and the struct k_mem_slab storage back to the kernel heap. The subsequent i2s_buf_write(), i2s_buf_read(), or driver DMA/ISR completion then calls k_mem_slab_alloc() / k_mem_slab_free() through the stale pointer. The result is a supervisor-mode use-after-free reachable from an unprivileged user thread: the freed block is read and written (free_list, wait queue, info.num_used) after the attacker can have caused it to be reused by an unrelated kernel object, which undermines the isolation that CONFIG_USERSPACE is meant to provide. Exploitation requires CONFIG_USERSPACE together with CONFIG_DYNAMIC_OBJECTS, and an application that hands a dynamically allocated, initialized memory slab to a user thread that becomes its last permission holder — k_mem_slab_init() is not itself a system call, so a user thread cannot create such a slab unaided. Builds that use only statically declared slabs (K_MEM_SLAB_DEFINE) are unaffected. The fix replaces the check with K_SYSCALL_OBJ_STATIC(), which additionally rejects objects carrying K_OBJ_FLAG_ALLOC, so only slabs that can never be freed reach the driver. | |
| Title | Use-after-free in the I2S configure system call when a dynamically allocated memory slab is retained by the driver | |
| Weaknesses | CWE-367 CWE-416 |
|
| References |
| |
| Metrics |
cvssV3_1
|
Projects
Sign in to view the affected projects.
Status: PUBLISHED
Assigner: zephyr
Published:
Updated: 2026-12-03T19:39:23.539Z
Reserved: 2026-09-04T20:48:41.512Z
Link: CVE-2026-86092
No data.
No data.
No data.
OpenCVE Enrichment
No data.