🇰🇷 한글 설명
Linux 커널의 io_uring/net 구성 요소에서 번들 수신 재시도 시 IORING_CQE_F_BUF_MORE 플래그가 올바르게 상속되지 않는 취약점입니다. 이로 인해 사용자 공간이 커널이 여전히 사용 중인 버퍼를 잘못된 시점에 재사용하여 데이터 무결성 문제가 발생할 수 있습니다.
💡 쉬운 설명
데이터를 받는 과정에서 시스템이 '이 버퍼를 더 써도 된다'는 신호를 놓치는 버그입니다. 이로 인해 컴퓨터가 아직 사용 중인 메모리 공간을 다른 용도로 잘못 사용하게 되어 오류가 생길 수 있습니다.
🇺🇸 원문 (English)
In the Linux kernel, the following vulnerability has been resolved:
io_uring/net: inherit IORING_CQE_F_BUF_MORE across bundle recv retries
When a bundle recv retries inside io_recv_finish(), the merge logic OR
the saved cflags from the previous iteration with the cflags returned by
the new iteration:
cflags = req->cqe.flags | (cflags & CQE_F_MASK);
Bits listed in CQE_F_MASK are inherited from the new iteration, and all
other bits (notably IORING_CQE_F_BUFFER and the buffer ID) come from the
saved cflags. Before this change CQE_F_MASK covered only
IORING_CQE_F_SOCK_NONEMPTY and IORING_CQE_F_MORE.
When using provided buffer rings (IOU_PBUF_RING_INC) with incremental
mode, and bundle recv, io_kbuf_inc_commit() can leave the head ring
entry partially consumed, __io_put_kbufs() then sets
IORING_CQE_F_BUF_MORE on the returned cflags so userspace knows the
buffer ID will be reused for subsequent completions.
Because IORING_CQE_F_BUF_MORE was not in CQE_F_MASK, the merge above
silently dropped it whenever the final retry iteration partially
consumed the buffer, and the subsequent req->cqe.flags = cflags &
~CQE_F_MASK save would have left a stale IORING_CQE_F_BUF_MORE in the
carried-over cflags had one been present. Userspace would then
wrongfully advance it ring head past an entry the kernel still uses.
Add IORING_CQE_F_BUF_MORE to CQE_F_MASK so it is both inherited from the
new iteration into the user-visible CQE and stripped from the saved
cflags between iterations.
📍 영향받는 시스템
Linux kernel (io_uring/net 관련 기능 사용 시)
⚔️ 공격 벡터
특정 조건의 io_uring 번들 수신(bundle recv) 요청을 통해 메모리 관리 로직의 오류를 유도
🛡️ 대응 방법
Linux 커널을 최신 보안 패치가 적용된 버전으로 업데이트
🔧 검증 코드
출력된 커널 버전이 해당 취약점이 해결된 패치 버전 이후인지 확인