CVE-2026-104928

Kernel object validation bypass in k_thread_stack_space_get syscall verifier with CONFIG_NO_RUNTIME_CHECKS

Published Nov 27, 2026 CVSS 3.1 · 2.8 Low EPSS n/a KEV · Not listed
Description
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.

Analysis

AI-generated

Technical impact

A flaw in the kernel system call verifier for k_thread_stack_space_get allows unprivileged threads that run on a Zephyr kernel configured with CONFIG_USERSPACE, CONFIG_INIT_STACKS, and CONFIG_THREAD_STACK_INFO to supply an arbitrary thread pointer. The verifier mistakenly uses a conditional macro that can resolve to a no‑operation when CONFIG_NO_RUNTIME_CHECKS is selected, resulting in the kernel bypassing the object type check. The kernel then dereferences the supplied pointer’s stack_info field and reads memory starting at the attacker‑chosen address, returning the number of leading 0xAA bytes. This provides a limited oracle that can reveal content from arbitrary kernel or peripheral memory, including MMIO, though no write operation is possible. The flaw is not present under the default CONFIG_RUNTIME_ERROR_CHECKS configuration, but the exploit exists when the build selectively disables runtime checks or assertions.

Affected Systems

Zephyr Project Zephyr OS. No specific version information is provided in the advisory. The vulnerability applies to builds of Zephyr that include the stated configuration options.

Risk and Exploitability

The CVSS score of 2.8 indicates low severity, and no EPSS score is reported. The bug is not listed in the CISA KEV catalog. The vulnerability requires that the target system has been compiled with the specific configuration set that eliminates runtime checks. An attacker with a local user thread can exercise the whitespace oracle to read arbitrary memory, but discovering exploitable data and achieving further compromise would require additional steps. The exploit is local to the kernel and cannot remotely inject code.

Remediation

No solution or workaround provided in the CVE record.

OpenCVE Recommended Actions

  • Update the Zephyr kernel to a version that contains the commit fixing the verifier logic (replace CHECKIF() with K_OOPS()), ensuring the kernel enforces object validation in all builds.
  • If upgrading is not immediately possible, rebuild the Zephyr kernel with CONFIG_NO_RUNTIME_CHECKS disabled or enable CONFIG_ASSERT_ON_ERRORS so that assertion checks are performed for thread pointers. This restores the kernel's safety net without changing the code path.
  • After recompiling or upgrading, verify that k_thread_stack_space_get() no longer succeeds when supplied with arbitrary thread pointers by attempting a test read of an invalid stack memory region, confirming that an error is raised in kernel mode.

Generated by OpenCVE AI on November 27, 2026 at 16:50 UTC.

Tracking

Sign in to view the affected projects.

Advisories

No advisories available
History
Type Values Removed Values Added
First Time appeared Zephyrproject
Zephyrproject zephyr
Vendors & Products Zephyrproject
Zephyrproject zephyr
Type Values Removed Values Added
Description 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.
Title Kernel object validation bypass in k_thread_stack_space_get syscall verifier with CONFIG_NO_RUNTIME_CHECKS
Weaknesses CWE-862
References
Metrics cvssV3_1

{'score': 2.8, 'vector': 'CVSS:3.1/AV:L/AC:H/PR:L/UI:N/S:C/C:L/I:N/A:N'}

Weaknesses

Sources

Status
PUBLISHED
Assigner
zephyr
Published
Updated
Nov 27, 2026, 3:42 PM
Reserved
Oct 2, 2026, 4:55 PM
Status
Awaiting Analysis
Published
Nov 27, 2026, 4:18 PM
Modified
Nov 27, 2026, 4:18 PM