Zephyrのカーネルで任意のメモリを読み書きされる脆弱性、ユーザーモードから悪用可能
Summary
Zephyrには、RTIOのシステムコールの検証で権限チェックの結果が反転し、ユーザーモードのスレッドからカーネルの任意のメモリを読み書きされる脆弱性があります。影響を受けるのはバージョン3.3.0以降4.3.2未満と4.4.0以降4.5.0未満で、修正版は4.3.2と4.5.0です。修正版へ更新してください。
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には、RTIOのシステムコールの検証で権限チェックの結果が反転し、ユーザーモードのスレッドからカーネルの任意のメモリを読み書きされる脆弱性があります。影響を受けるのはバージョン3.3.0以降4.3.2未満と4.4.0以降4.5.0未満で、修正版は4.3.2と4.5.0です。修正版へ更新してください。
Affected packages
| Package | Affected → Fixed | |
|---|---|---|
| zephyrprojectzephyr |
≥ 3.3.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 RTIO submission-queue verifier rtio_vrfy_sqe() in subsys/rtio/rtio_syscalls.c (subsys/rtio/rtio_handlers.c before v4.3.0) accumulated the results of K_SYSCALL_MEMORY() into its valid_sqe flag with &=. That macro returns nonzero on failure (it is built on K_SYSCALL_VERIFY_MSG(), which yields !(expr)), so every buffer permission check contributed the opposite of its result. A submission whose tx.buf, rx.buf or txrx.tx_buf/txrx.rx_buf pointer was not accessible to the calling thread was accepted, while a legitimate, thread-owned buffer caused the calling thread to be killed with a kernel oops.
The verifier runs on behalf of the rtio_sqe_copy_in_get_handles() system call (also reached through the inline rtio_sqe_copy_in() wrapper), so it is driven directly by untrusted user-mode input on any image built with CONFIG_USERSPACE. A user thread that has been granted an RTIO context and an rtio_iodev object — the intended usage of RTIO userspace support, established via rtio_access_grant() — can submit an SQE whose buffer pointer and length name arbitrary kernel memory; the object check on sqe->iodev is unaffected and still passes, and the crafted SQE is forwarded to the bus driver unchanged.
Downstream consumers dereference the pointer with supervisor privilege. The generic I2C and I3C RTIO fallback handlers (drivers/i2c/i2c_rtio_default.c, drivers/i3c/i3c_rtio_default.c) copy sqe.rx.buf/sqe.tx.buf into struct i2c_msg and call i2c_transfer(), and the vendor SPI/I2C RTIO drivers…
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