🔍 CVE-2026-12631

6.5
CVSS Score
MEDIUM
2026-08-18
2026-10-22 22:10
✅ 완료

🇰🇷 한글 설명

Zephyr 커널의 k_thread_join() 및 k_thread_abort() 시스템 호출 검증 과정에서 오류가 발생하여, 권한이 없는 사용자가 잘못된 스레드 객체에 접근할 경우 커널이 충돌하거나 접근 제어를 우회할 수 있는 취약점입니다. Clang 빌드에서는 커널 패닉을 유발하여 서비스 거부(DoS)가 가능하며, GCC 빌드에서는 권한 없는 스레드 조작이 가능한 접근 제어 우회 문제가 발생할 수 있습니다.

💡 쉬운 설명

일반 사용자가 시스템의 중요한 부분을 건드리지 못하도록 막는 검문소가 고장 난 상태입니다. 이로 인해 공격자가 시스템을 강제로 멈추게 하거나, 허가되지 않은 동작을 수행할 수 있습니다.

🇺🇸 원문 (English)

The Zephyr kernel validates the k_thread_join() and k_thread_abort() system calls (declared __syscall in include/zephyr/kernel.h) through thread_obj_validate() in kernel/thread.c. Its default switch branch is the access-denied path, taken when k_object_validate() returns -EPERM (the calling user thread was never granted access to the target thread object) or -EBADF (the supplied pointer is not a registered kernel object of the right type). That branch invoked K_OOPS(K_SYSCALL_VERIFY_MSG(ret, "access denied")), but K_SYSCALL_VERIFY_MSG treats a true expression as success; the non-zero error code ret therefore read as "verified OK", the kernel oops was never raised, and control fell through to CODE_UNREACHABLE. Because k_thread_join() and k_thread_abort() are system calls, an unprivileged user-mode thread (under CONFIG_USERSPACE) can reach this denial path directly by calling either syscall on a thread object it does not own. Instead of the offending thread being cleanly terminated, execution reaches __builtin_unreachable() while running in supervisor mode inside the syscall handler. On Clang builds CODE_UNREACHABLE emits an illegal-instruction trap, so a user thread can deterministically crash the kernel — a locally triggerable denial of service that escapes the userspace sandbox. On GCC builds the path is undefined behavior: the compiler may drop the return-value handling for thread_obj_validate(), so it can return an undefined bool; if that is false, the caller proceeds into the real k_thread_join()/k_thread_abort() implementation for a thread the user was never authorized to access, an access-control bypass. The fix changes the verification expression to ret == 0, so a denied (non-zero) result now correctly raises K_OOPS and terminates the offending caller.

📍 영향받는 시스템

Zephyr RTOS (CONFIG_USERSPACE가 활성화된 환경)

⚔️ 공격 벡터

권한이 없는 사용자 모드 스레드에서 소유하지 않은 스레드 객체를 대상으로 k_thread_join() 또는 k_thread_abort() 시스템 호출 실행

🛡️ 대응 방법

검증 로직을 ret == 0으로 수정하여 에러 발생 시 K_OOPS가 정상적으로 호출되도록 커널 패치 적용

🔧 검증 코드

검증 로직이 ret == 0 형태가 아닌 단순 ret 형태라면 취약한 버전입니다.

Shell / Script
grep -r "K_SYSCALL_VERIFY_MSG(ret" kernel/thread.c

📊 CVSS Vector String

CVSS Vector
CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:C/C:N/I:N/A:H

💻 영향받는 소프트웨어

Windows iSCSI Target Service