Zephyrの脆弱性、特権のないユーザーモードのスレッドから カーネルのメモリを壊される
Summary
Zephyrのカーネルオブジェクト管理に解放済みメモリを使う脆弱性があり、特権のないユーザーモードのスレッドから、カーネルのメモリを壊されるおそれがあります。影響するのは3.5.0以上4.3.2未満と4.4.0以上4.5.0未満で、修正版は4.3.2と4.5.0です。CVSSは7.7で、該当するバージョンの利用者は修正版への更新を優先してください。
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のカーネルオブジェクト管理に解放済みメモリを使う脆弱性があり、特権のないユーザーモードのスレッドから、カーネルのメモリを壊されるおそれがあります。影響するのは3.5.0以上4.3.2未満と4.4.0以上4.5.0未満で、修正版は4.3.2と4.5.0です。CVSSは7.7で、該当するバージョンの利用者は修正版への更新を優先してください。
Affected packages
| Package | Affected → Fixed | |
|---|---|---|
| zephyrprojectzephyr |
≥ 3.5.0, < 4.3.2→ 4.3.2 ≥ 4.4.0, < 4.5.0→ 4.5.0 |
4.3.2 4.5.0 |
Original description The description as published by the source.
The kernel object core framework (kernel/obj_core.c) linked every participating kernel object (semaphores, mutexes, message queues, stacks, pipes, events, and so on) into a per-type singly linked list through a sys_snode_t embedded in the object itself. k_obj_core_link() appended the object with sys_slist_append(), and nothing ever unlinked these objects except threads. When an object's storage was freed, went out of scope, or was reused while it was the list tail, the list kept pointing into dead memory. The next k_obj_core_init_and_link() (for example from k_sem_init()) then wrote a pointer through that stale node. Re-initializing the current tail object also made the list self-referential, so k_obj_type_walk_locked() / k_obj_type_walk_unlocked() loop forever.
When CONFIG_OBJ_CORE, CONFIG_USERSPACE and CONFIG_DYNAMIC_OBJECTS are all enabled, an unprivileged user-mode thread can trigger this through system calls alone. It allocates a semaphore with k_object_alloc(), initializes it with k_sem_init(), and releases it with k_object_release(). unref_check() then frees the object without unlinking it, and the thread's next k_sem_init() makes the kernel write a kernel pointer into the freed (and possibly reallocated) kernel heap chunk. In kernel-only builds with CONFIG_OBJ_CORE enabled, the same defect corrupts memory during ordinary operation, because k_work_flush() and k_work_cancel_sync() initialize semaphores on the caller's stack.
The result is supervisor-mode memory corrup…
Source: CVE.org (CVE Program・cvelistV5) NVD GitHub Advisory
References
- advisory github.com
- advisory github.com
- advisory nvd.nist.gov
- package github.com
- patch github.com