PT-2026-108759 · Zephyrproject · Zephyr
CVE-2026-19575
·
Published
2026-10-09
·
Updated
2026-10-09
CVSS v3.1
7.8
High
| Vector | AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H |
The user-mode verification handler for the device deinit() system call, z vrfy device deinit() in kernel/device.c, validated its dev argument with K SYSCALL OBJ INIT(dev, K OBJ ANY). k object validate() short-circuits its type comparison when the requested type is K OBJ ANY, so the check reduced to "this pointer is the base address of some kernel object the calling thread has been granted" — the object's actual type was never compared, and K SYSCALL OBJ INIT also skips the initialization-state check. The sibling handlers z vrfy device init() and z vrfy device is ready() already used K OBJ DRIVER ANY and were unaffected.
A thread running in user mode can therefore pass any kernel object it holds permission on — most usefully a thread stack object obtained from the k thread stack alloc() syscall or a statically defined K THREAD STACK it was granted in order to spawn a child user thread — whose backing memory is writable from user mode. z impl device deinit() then interprets those attacker-written bytes as a struct device: it dereferences the state pointer read out of the object, calls the function pointer read out of ops.deinit, and on success writes through state again. The result is an indirect call to an arbitrary address executed in supervisor mode, plus an arbitrary kernel read and a single-byte kernel write.
Exploitation gives a local unprivileged thread full kernel code execution, defeating the CONFIG USERSPACE isolation boundary entirely; a less precise attempt yields a supervisor-mode fault and a system crash. The defect is only reachable in builds that enable both CONFIG USERSPACE and CONFIG DEVICE DEINIT SUPPORT — with de-initialization support disabled, z impl device deinit() returns -ENOTSUP without ever dereferencing the pointer. In v4.2.x and v4.3.x, CONFIG DEVICE DEINIT SUPPORT defaulted to y, so every CONFIG USERSPACE build of those releases is exposed unless the option was explicitly turned off. From v4.4.0 the option is opt-in (no default, and not selected by any in-tree subsystem), so a v4.4.x build is exposed only if it enables the option explicitly. The v4.2 line is no longer maintained and receives no backport.
The fix changes the object check to K OBJ DRIVER ANY, which constrains the argument to the build-generated driver object type range (K OBJ DRIVER FIRST..K OBJ DRIVER LAST) — the real struct device instances placed by the linker — so the state and ops.deinit fields are once again kernel-controlled.
Fix
Type Confusion
Found an issue in the description? Have something to add? Feel free to write us 👾
Weakness Enumeration
Related Identifiers
Affected Products
Zephyr