CVE-2026-104928: Kernel object validation bypass in k_thread_stack_space_get syscall verifier with CONFIG_NO_RUNTIME_CHECKS
The system call verifier zvrfykthreadstackspaceget() in kernel/thread.c checked the result of KSYSCALLOBJ(thread, KOBJTHREAD) with the CHECKIF() macro instead of KOOPS(). CHECKIF() compiles to if (0) when CONFIGNORUNTIMECHECKS is selected, and becomes an assertion when CONFIGASSERTONERRORS is selected. In both cases, the kernel-object validation result for the user-supplied thread pointer is ignored, or is a no-op when assertions are disabled.
On builds with CONFIGUSERSPACE, CONFIGINITSTACKS and CONFIGTHREADSTACKINFO plus one of those check modes, a user-mode thread can call kthreadstackspaceget() with an arbitrary pointer. That pointer can be a fake struct kthread in its own memory, or a thread object it has no permission on. zimplkthreadstackspaceget() then dereferences thread->stackinfo in supervisor mode and scans memory starting at the attacker-chosen stackinfo.start.
The syscall returns the number of leading 0xAA bytes at that address. This gives an unprivileged thread a limited oracle on arbitrary kernel or peripheral memory, and allows privileged reads of attacker-selected addresses, including MMIO. No write primitive results. The default CONFIGRUNTIMEERRORCHECKS configuration is not affected. The fix replaces the CHECKIF() with KOOPS() so the object check is always enforced.
Affected Software
Remediation
Recommended actions to resolve this vulnerability, in priority order.
- Compensating control
In kernel/thread.c, replace CHECKIF() with K_OOPS() in z_vrfy_k_thread_stack_space_get() so the K_SYSCALL_OBJ(thread, K_OBJ_THREAD) validation is always enforced.
Event History
Frequently Asked Questions
Which builds are exposed?
Exposure requires CONFIG_USERSPACE, CONFIG_INIT_STACKS, and CONFIG_THREAD_STACK_INFO, together with a check mode where CHECKIF() is compiled out or reduced to an ineffective assertion as described. The provided data does not establish whether this configuration is enabled by default.
What does an attacker need to exploit this?
An attacker needs the ability to run a user-mode thread and invoke k_thread_stack_space_get(). They can supply either a fake k_thread structure in memory they control or a thread object for which they lack permission.
What can exploitation reveal or modify?
The syscall dereferences attacker-selected stack_info values in supervisor mode and reports the number of leading 0xAA bytes at the selected address. This provides a limited memory-content oracle and can cause privileged reads of kernel, peripheral, or MMIO addresses, but no write primitive is described.
What can be done before a patch is available?
Avoid the affected configuration combination by ensuring the required userspace, stack-initialization, stack-info, and ineffective runtime-check modes are not jointly enabled. Review build configuration for CONFIG_NO_RUNTIME_CHECKS and the relevant assertion behavior, since these modes cause the object-validation result to be ignored or ineffective.