🇰🇷 한글 설명
Linux 커널의 io_uring/cmd 구성 요소에서 비동기 명령(async cmd)이 재사용되지 않을 때 iovec 배열이 해제되지 않는 메모리 누수 취약점이 발견되었습니다. 특정 조건에서 캐시가 가득 차면 할당된 메모리가 해제되지 않고 남게 되어 시스템 자원을 소모할 수 있습니다.
💡 쉬운 설명
컴퓨터가 작업을 처리하기 위해 메모리를 빌려온 뒤, 작업이 끝나도 이를 돌려주지 않고 계속 쌓아두는 버그입니다. 이 문제가 지속되면 컴퓨터의 메모리가 점차 부족해질 수 있습니다.
🇺🇸 원문 (English)
In the Linux kernel, the following vulnerability has been resolved:
io_uring/cmd: fix iovec leak when the async cmd is not recycled
An io_async_cmd carries an iovec array in ->vec.iovec, allocated when the
vec has to grow and kept across recycling through ctx->cmd_cache. On two
paths nothing frees it and io_clean_op()'s kfree(req->async_data) drops
the io_async_cmd without it.
io_req_uring_cleanup() clears the async data flags only when
io_alloc_cache_put() succeeds, and the cache holds IO_ALLOC_CACHE_MAX ==
128 entries, so once it is full the put fails and the vec is left behind.
An NVMe passthrough workload gets there without doing anything unusual:
nvme_uring_cmd_io() returns -EIOCBQUEUED, so the io_async_cmd stays
attached for the lifetime of the command and the live object count tracks
the queue depth. Above 128 the puts start failing.
->cleanup is the last chance to free an inherited vec, since
io_req_uring_cleanup() returns early for an io-wq issued command and is
not called at all for one completed without ever being issued. But
io_clean_op() calls ->cleanup only if REQ_F_NEED_CLEANUP is set, and for
uring_cmd that happens only where the vec has to grow, so a command
reusing a large enough cached vec never sets it. io_rw_alloc_async() and
io_msg_alloc_async() flag an inherited vec for exactly this reason;
io_uring_cmd_prep() does not.
Flag an inherited vec in io_uring_cmd_prep(), and free the vec when the
cache put fails, as io_req_rw_cleanup() does.
The leak is invisible under KASAN, where io_alloc_cache_vec_kasan() frees
the vec unconditionally.
📍 영향받는 시스템
Linux Kernel (io_uring/cmd를 사용하는 버전)
⚔️ 공격 벡터
특정 NVMe 패스스루 워크로드를 반복적으로 실행하여 메모리 누수를 유도하는 방식
🛡️ 대응 방법
Linux 커널을 최신 보안 패치가 적용된 버전으로 업데이트하십시오.
🔧 검증 코드
출력된 커널 버전이 해당 취약점이 수정된 최신 패치 버전인지 확인하십시오.