🔍 CVE-2026-19595

6.1
CVSS Score
MEDIUM
2026-10-19
2026-10-20 20:17
✅ 완료

🇰🇷 한글 설명

RTIO 서브시스템의 syscall 검증 과정에서 출력 매개변수에 대해 쓰기 권한이 아닌 읽기 권한 검증(K_SYSCALL_MEMORY_READ)을 수행하는 취약점입니다. 이로 인해 권한이 없는 사용자가 읽기 전용 메모리 영역에 데이터를 기록하여 보호 기능을 우회하거나, 시스템을 중단시켜 서비스 거부(DoS)를 유발할 수 있습니다.

💡 쉬운 설명

시스템이 데이터를 저장할 위치가 '쓰기 가능한지' 확인해야 하는데, 실수로 '읽기 가능한지'만 확인하여 발생한 문제입니다. 공격자는 이를 이용해 수정하면 안 되는 중요한 데이터를 바꾸거나 시스템을 강제로 멈추게 할 수 있습니다.

🇺🇸 원문 (English)

The user-mode syscall verifier z_vrfy_rtio_cqe_get_mempool_buffer() in subsys/rtio/rtio_syscalls.c validated its two output parameters, buff and buff_len, with K_SYSCALL_MEMORY_READ() rather than K_SYSCALL_MEMORY_WRITE(). Both are pure out-parameters: z_impl_rtio_cqe_get_mempool_buffer() stores the mempool buffer address and its length through them. The distinction is enforced by every architecture validator — arch_buffer_validate() on RISC-V PMP explicitly accepts the global __rom_region/__rodata_region for reads only, and the ARM MPU validators accept P_RO_U_RO and P_RW_U_RO regions for reads only — so a read-validated pointer is not necessarily writable by the calling thread. An unprivileged user-mode thread that has been granted access to an RTIO context (rtio_access_grant()) can invoke the rtio_cqe_get_mempool_buffer() syscall with buff/buff_len pointing at memory it may read but not write, and with a completion-queue entry whose flags field it fully controls (only RTIO_CQE_FLAG_MEMPOOL_BUFFER in flags[7:0] is required; flags[19:8] and flags[31:20] supply the block index and count). The kernel then performs a pointer-sized and a 4-byte store through those addresses while running in supervisor mode. Reaching the store requires CONFIG_USERSPACE together with CONFIG_RTIO_SYS_MEM_BLOCKS, the configuration behind RTIO_DEFINE_WITH_MEMPOOL; without the latter the implementation returns -ENOTSUP and writes nothing. Two outcomes follow. If the target lies in a memory-domain partition declared K_MEM_PARTITION_P_RW_U_RO (privileged read-write, user read-only), the kernel-mode store succeeds and deposits partly attacker-chosen values into memory the memory domain had marked read-only for that thread, bypassing the partition's write protection. If the target lies in globally readable but unwritable memory such as .text/.rodata in flash, the store faults in kernel mode; the fault is delivered to z_fatal_error() and the default k_sys_fatal_error_handler() halts or reboots the device, giving an unprivileged thread a reliable full denial of service. The read-permission check does bound the damage: the address must still be readable by the calling thread, so kernel-private memory cannot be targeted and no confidential data is disclosed. The fix replaces both checks with K_SYSCALL_MEMORY_WRITE(), so a thread lacking write permission is terminated by K_OOPS before the implementation runs; the cqe argument correctly remains read-validated.

📍 영향받는 시스템

CONFIG_USERSPACE 및 CONFIG_RTIO_SYS_MEM_BLOCKS가 활성화된 RTIO 환경을 사용하는 시스템

⚔️ 공격 벡터

권한이 낮은 사용자가 읽기 전용 메모리 주소를 매개변수로 전달하여 syscall을 호출함으로써 메모리 변조 또는 시스템 중단 유도

🛡️ 대응 방법

K_SYSCALL_MEMORY_READ() 검증 로직을 K_SYSCALL_MEMORY_WRITE()로 교체하여 올바른 쓰기 권한을 확인하도록 수정

🔧 검증 코드

명령어 결과에 K_SYSCALL_MEMORY_READ가 포함되어 있다면 취약한 버전이며, K_SYSCALL_MEMORY_WRITE로 수정되어 있어야 안전합니다.

Shell / Script
grep -r "z_vrfy_rtio_cqe_get_mempool_buffer" subsys/rtio/rtio_syscalls.c | grep "K_SYSCALL_MEMORY_READ"

📊 CVSS Vector String

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

💻 영향받는 소프트웨어

Windows iSCSI Target Service