Zephyrのユーザーモードで動的オブジェクトが解放され、任意のコードを実行される脆弱性
Summary
Zephyrのカーネルのユーザーモードのオブジェクト管理に解放後使用の脆弱性があり、権限を持つユーザースレッドから、解放済みのメモリを悪用される可能性があります。CVSSは8.8で、影響を受けるのは1.12.0以降のzephyrです。修正版は公表されていないため、最新の情報を確認してください。
AI summary
Produced by SecPulse using an external AI model; it may contain mistakes. Check the original description and references below before acting on it.
Zephyrのカーネルのユーザーモードのオブジェクト管理に解放後使用の脆弱性があり、権限を持つユーザースレッドから、解放済みのメモリを悪用される可能性があります。CVSSは8.8で、影響を受けるのは1.12.0以降のzephyrです。修正版は公表されていないため、最新の情報を確認してください。
Affected packages
| Package | Affected → Fixed | |
|---|---|---|
| zephyrprojectzephyr |
≥ 1.12.0 (no fix yet)→ Not listed |
Not listed |
This record does not list fixed versions. Check the article or the vendor advisory in the references for whether and where it is fixed.
Original description The description as published by the source.
In the kernel's user-mode object management, unref_check() in kernel/userspace/userspace.c frees a dynamically allocated kernel object as soon as its permission bitmap becomes empty. It does not check the object type or whether the kernel still uses the object. k_thread_create() keeps pointers to a dynamic struct k_thread (from k_object_alloc(K_OBJ_THREAD)) and a dynamic stack (from k_object_alloc_size(K_OBJ_THREAD_STACK_ELEMENT, ...) or k_thread_stack_alloc() with K_USER) for the whole life of the thread, but nothing in the bitmap records this. z_thread_user_init() gives the new thread permission on its own thread object only, not on its stack. When the thread terminates, halt_thread() calls z_thread_release(), and its z_thread_user_exit() drops all of the thread's permissions. If that leaves the bitmap empty, the thread's own struct k_thread (and a stack it holds the last permission on) is freed before the abort path and the context switch are done with it.
Any user thread with a resource pool can trigger this through syscalls it is allowed to make. If it creates a thread on a dynamic stack and then calls k_object_release() on the stack, or exits, the stack block is freed while the child still runs on it. With CONFIG_GEN_PRIV_STACKS that block also holds the privileged stack and z_stack_data, and the child keeps user-mode access to it. Once the creator has released a dynamic thread object, the thread itself can call k_object_release() on its own thread object and free its…
Source: CVE.org (CVE Program・cvelistV5) NVD