🇰🇷 한글 설명
Linux 커널의 fuse-uring 구성 요소에서 등록 과정과 연결 중단 사이의 레이스 컨디션(Race Condition) 취약점이 발견되었습니다. 이로 인해 연결이 중단될 때 프로세스가 무한 대기 상태(unkillable state)에 빠지며, 리소스 누수가 발생할 수 있습니다.
💡 쉬운 설명
컴퓨터가 작업을 등록하는 도중에 갑자기 연결을 끊으려고 하면, 시스템이 어떤 작업을 해야 할지 몰라 멈춰버리는 현상입니다. 이로 인해 시스템 자원이 낭비되고 컴퓨터가 응답하지 않을 수 있습니다.
🇺🇸 원문 (English)
In the Linux kernel, the following vulnerability has been resolved:
fuse-uring: fix race between registration and connection abortion
This fixes this race:
- thread a: io_uring_enter -> register sqe ->
fuse_uring_create_ring_ent -> allocate ent but doesn't grab queue_ref
yet
- thread b: fuse_conn_destroy() -> fuse_chan_abort() ->
fuse_uring_abort() is a no-op due to queue ref being 0
- thread a: grabs the queue_ref, queue_ref is now 1, rest of
fuse_uring_do_register() logic executes
- thread b: fuse_chan_abort() returns, fuse_chan_wait_aborted() now runs
and calls
"wait_event(ring->stop_waitq, atomic_read(&ring->queue_refs) == 0);"
The abort/unmount thread will hang indefinitely in unkillable state as
nothing will decrement queue_refs or wake stop_waitq, and the ring,
queue, and ent are leaked.
Fix this by checking fch->connected under fch->lock after the created
ent has grabbed a ref count on the queue. This ensures that in the
scenario above, it is guaranteed that we either release the queue ref
and wake up stop_waitq (in case fuse_chan_wait_aborted() is already
waiting) in fuse_uring_do_register() when we detect !fch->connected, or
if the connection is aborted after the check, it is guaranteed that the
async teardown worker will be running in the background cleaning up ents
and decrementing the ent's ref on the queue, which will unblock the
eventual queue and ring teardown.
📍 영향받는 시스템
Linux kernel (fuse-uring 관련 모듈 사용 시)
⚔️ 공격 벡터
특정 타이밍에 FUSE 연결을 의도적으로 중단시켜 커널 스레드를 무한 대기 상태로 유도
🛡️ 대응 방법
Linux 커널을 최신 보안 패치가 적용된 버전으로 업데이트
🔧 검증 코드
출력된 커널 버전이 해당 취약점이 해결된 패치 버전 이후인지 확인