CVE-2026-104928 in Zephyrinfo

Summary

by MITRE • 11/27/2026

The system call verifier z_vrfy_k_thread_stack_space_get() in kernel/thread.c checked the result of K_SYSCALL_OBJ(thread, K_OBJ_THREAD) with the CHECKIF() macro instead of K_OOPS(). CHECKIF() compiles to if (0) when CONFIG_NO_RUNTIME_CHECKS is selected, and becomes an assertion when CONFIG_ASSERT_ON_ERRORS 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 CONFIG_USERSPACE, CONFIG_INIT_STACKS and CONFIG_THREAD_STACK_INFO plus one of those check modes, a user-mode thread can call k_thread_stack_space_get() with an arbitrary pointer. That pointer can be a fake struct k_thread in its own memory, or a thread object it has no permission on. z_impl_k_thread_stack_space_get() then dereferences thread->stack_info in supervisor mode and scans memory starting at the attacker-chosen stack_info.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 CONFIG_RUNTIME_ERROR_CHECKS configuration is not affected. The fix replaces the CHECKIF() with K_OOPS() so the object check is always enforced.

If you want to get best quality of vulnerability data, you may have to visit VulDB.

Analysis

by VulDB Data Team • 11/27/2026

The vulnerability identified in this analysis stems from a critical logic error within the Linux kernel's thread management subsystem, specifically involving the system call verifier function z_vrfy_k_thread_stack_space_get located in kernel/thread.c. This flaw arises because the verification of user-supplied thread pointers relies on the CHECKIF macro rather than the K_OOPS macro for validating kernel object integrity. The operational behavior of this check is inconsistent and dependent on specific configuration flags, creating a dangerous attack surface when certain conditions are met. Specifically, when CONFIG_NO_RUNTIME_CHECKS or CONFIG_ASSERT_ON_ERRORS is selected, the validation mechanism fails to properly enforce security constraints. In the case of CONFIG_NO_RUNTIME_CHECKS, CHECKIF compiles down to an if statement that evaluates to zero effectively disabling the check entirely. When CONFIG_ASSERT_ON_ERRORS is active, it becomes a standard assertion which may be bypassed or ignored depending on runtime conditions, thereby allowing invalid kernel object references to pass verification without triggering appropriate fault handling mechanisms like K_OOPS would enforce consistently.

This architectural flaw has severe implications for systems configured with userspace support enabled via CONFIG_USERSPACE alongside stack initialization and thread information features such as CONFIG_INIT_STACKS and CONFIG_THREAD_STACK_INFO. Under these configurations, an unprivileged user-mode thread can invoke the k_thread_stack_space_get system call using a completely arbitrary pointer value rather than a legitimate handle to a valid kernel thread object. The attacker constructs this malicious input by either placing a fabricated struct k_thread structure within their own memory space or referencing a thread object for which they lack any permission rights. Because the verification step is compromised, the kernel proceeds to execute z_impl_k_thread_stack_space_get with this unvalidated pointer in supervisor mode. This results in the direct dereferencing of the stack_info member from the attacker-controlled data structure and initiates memory scanning operations starting at an address chosen by the adversary via stack_info.start.

The exploitation of this vulnerability provides a powerful information disclosure primitive that functions as a side-channel oracle against arbitrary kernel memory, peripheral registers, and memory-mapped I/O regions. By analyzing the return value which indicates the count of leading 0xAA bytes found during the scan, an attacker can iteratively probe different addresses to determine their contents without writing any data. This capability allows for privileged reads across boundaries that should be strictly enforced by the kernel's isolation mechanisms. The ability to read MMIO space is particularly concerning as it may expose sensitive hardware state or configuration details that could facilitate further exploitation steps such as privilege escalation or denial of service attacks against system stability. It is important to note that this vulnerability does not affect systems running with the default CONFIG_RUNTIME_ERROR_CHECKS configuration which maintains proper validation logic, but remains a significant risk for embedded and real-time operating system deployments where runtime checks are often disabled for performance reasons.

From a classification perspective, this issue aligns closely with CWE-20 Improper Input Validation as the core failure lies in not adequately validating user-supplied input before processing it within a privileged context. Furthermore, the exploitation technique maps to ATT&CK T1083 File and Directory Discovery or more accurately T1497 Virtualization/Sandbox Evasion through system state discovery depending on whether kernel memory or hardware registers are targeted. The lack of write capability limits the immediate impact but does not diminish the severity given the potential for information leakage that can aid in bypassing other security controls like ASLR or KASLR by revealing internal data structures and addresses.

Mitigation strategies must focus on ensuring consistent enforcement of object validation checks regardless of runtime configuration settings. The primary remediation involves replacing the CHECKIF macro with K_OOPS within z_vrfy_k_thread_stack_space_get to guarantee that kernel-object validation is always enforced even when assertions are disabled or runtime checks are minimized. Additionally, system administrators and developers should review their kernel configurations to ensure that CONFIG_RUNTIME_ERROR_CHECKS remains enabled in production environments where possible, as this default setting provides robust protection against such vulnerabilities. For systems requiring performance optimizations through disabled runtime checks, strict code auditing is necessary to identify similar patterns elsewhere in the kernel source tree. Patching involves updating the specific file kernel/thread.c and recompiling the kernel with the corrected verification logic applied universally across all supported configuration variants to eliminate the conditional bypass path exploited by attackers.

Responsible

Zephyr

Reservation

10/02/2026

Disclosure

11/27/2026

Moderation

accepted

CPE

ready

EPSS

0.00000

KEV

no

Activities

very low

Sources

Do you know our Splunk app?

Download it now for free!