🇰🇷 한글 설명
Linux 커널의 io_uring/net 구성 요소에서 io_bundle_nbufs() 함수 내 slab-out-of-bounds read 취약점이 발견되었습니다. 사용자 공간에서 sqe->len 값을 INT_MAX보다 크게 전달할 경우 정수 오버플로가 발생하여 무한 루프와 함께 할당된 메모리 범위를 벗어난 읽기 작업이 수행됩니다.
💡 쉬운 설명
컴퓨터가 데이터를 처리할 때 숫자가 너무 커서 계산 오류가 발생하는 현상을 이용한 공격입니다. 이 오류로 인해 시스템이 허용되지 않은 메모리 영역을 읽어 들여 보안 문제가 생길 수 있습니다.
🇺🇸 원문 (English)
In the Linux kernel, the following vulnerability has been resolved:
io_uring/net: fix slab-out-of-bounds read in io_bundle_nbufs()
sqe->len is __u32 but gets stored into sr->len which is int. When
userspace passes sqe->len values exceeding INT_MAX (e.g. 0xFFFFFFFF),
sr->len overflows to a negative value. This negative value propagates
through the bundle recv/send path:
1. io_recv(): sel.val = sr->len (ssize_t gets -1)
2. io_recv_buf_select(): arg.max_len = sel->val (size_t gets
0xFFFFFFFFFFFFFFFF)
3. io_ring_buffers_peek(): buf->len is not clamped because max_len
is astronomically large
4. iov[].iov_len = 0xFFFFFFFF flows into io_bundle_nbufs()
5. io_bundle_nbufs(): min_t(int, 0xFFFFFFFF, ret) yields -1,
causing ret to increase instead of decrease, creating an
infinite loop that reads past the allocated iov[] array
This results in a slab-out-of-bounds read in io_bundle_nbufs() from
the kmalloc-64 slab, as nbufs increments past the allocated iovec
entries.
BUG: KASAN: slab-out-of-bounds in io_bundle_nbufs+0x128/0x160
Read of size 8 at addr ffff888100ae05c8 by task exp/145
Call Trace:
io_bundle_nbufs+0x128/0x160
io_recv_finish+0x117/0xe20
io_recv+0x2db/0x1160
Fix this by rejecting negative sr->len values early in both
io_sendmsg_prep() and io_recvmsg_prep(). Since sqe->len is __u32,
any value > INT_MAX indicates overflow and is not a valid length.
📍 영향받는 시스템
Linux Kernel (io_uring/net 모듈 사용 시)
⚔️ 공격 벡터
사용자 공간에서 io_uring을 통해 매우 큰(INT_MAX 초과) sqe->len 값을 전달하여 정수 오버플로 유도
🛡️ 대응 방법
io_sendmsg_prep() 및 io_recvmsg_prep() 단계에서 음수 sr->len 값을 거부하도록 커널 패치 적용
🔧 검증 코드
현재 실행 중인 커널 버전을 확인하여 해당 취약점이 해결된 최신 보안 패치 버전인지 확인합니다.