🇰🇷 한글 설명
Linux 커널의 io_uring/msg_ring 모듈에서 io_msg_send_fd() 함수가 file_ptr에 대한 NULL 검사를 하지 않아 NULL 포인터 역참조가 발생합니다. 이로 인해 커널 패닉이 일어날 수 있으며, NULL 검사를 추가하여 수정되었습니다.
💡 쉬운 설명
리눅스 커널의 비동기 입출력 기능 중 메시지 전달 부분에 오류 확인이 빠져 있었습니다. 이 때문에 잘못된 메모리 접근이 발생해 시스템이 멈출 수 있습니다.
🇺🇸 원문 (English)
In the Linux kernel, the following vulnerability has been resolved:
io_uring/msg_ring: Fix NULL pointer dereference in io_msg_send_fd()
Syzkaller produced the below call trace:
BUG: KASAN: null-ptr-deref in io_msg_ring+0x3cb/0x9f0
Write of size 8 at addr 0000000000000070 by task repro/16399
CPU: 0 PID: 16399 Comm: repro Not tainted 6.1.0-rc1 #28
Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS 1.11.0-2.el7
Call Trace:
<TASK>
dump_stack_lvl+0xcd/0x134
? io_msg_ring+0x3cb/0x9f0
kasan_report+0xbc/0xf0
? io_msg_ring+0x3cb/0x9f0
kasan_check_range+0x140/0x190
io_msg_ring+0x3cb/0x9f0
? io_msg_ring_prep+0x300/0x300
io_issue_sqe+0x698/0xca0
io_submit_sqes+0x92f/0x1c30
__do_sys_io_uring_enter+0xae4/0x24b0
....
RIP: 0033:0x7f2eaf8f8289
RSP: 002b:00007fff40939718 EFLAGS: 00000246 ORIG_RAX: 00000000000001aa
RAX: ffffffffffffffda RBX: 0000000000000000 RCX: 00007f2eaf8f8289
RDX: 0000000000000000 RSI: 0000000000006f71 RDI: 0000000000000004
RBP: 00007fff409397a0 R08: 0000000000000000 R09: 0000000000000039
R10: 0000000000000000 R11: 0000000000000246 R12: 00000000004006d0
R13: 00007fff40939880 R14: 0000000000000000 R15: 0000000000000000
</TASK>
Kernel panic - not syncing: panic_on_warn set ...
We don't have a NULL check on file_ptr in io_msg_send_fd() function,
so when file_ptr is NUL src_file is also NULL and get_file()
dereferences a NULL pointer and leads to above crash.
Add a NULL check to fix this issue.
📍 영향받는 시스템
패치 이전의 Linux 커널 (6.1-rc1 등 io_uring msg_ring 기능을 포함한 버전)
⚔️ 공격 벡터
로컬 사용자가 잘못된 io_uring 메시지 링 요청을 제출해 NULL 포인터 역참조를 유발하고 커널 패닉을 일으킬 수 있음
🛡️ 대응 방법
배포판 제공 최신 커널 업데이트를 적용하거나 수정된 커널 버전으로 업그레이드하고 재부팅
🔧 검증 코드
출력된 커널 버전을 배포판 보안 공지 또는 커널 패치 이력과 비교하여 해당 수정이 포함되었는지 확인하며, io_uring 사용을 막으려면 sysctl kernel.io_uring_disabled 값을 확인할 수 있습니다.