🇰🇷 한글 설명
Linux 커널의 ublk 블록 장치에서 파티션 테이블을 읽을 때 데드락(교착 상태)이 발생할 수 있는 취약점입니다. 특정 프로세스가 장치를 열고 읽기 작업을 수행하는 과정에서 동일한 뮤텍스를 중복 획득하려 시도하여 시스템이 멈출 수 있습니다.
💡 쉬운 설명
컴퓨터가 하드디스크의 정보를 읽으려고 할 때, 자기 자신이 이미 잡고 있는 열쇠를 다시 잡으려고 기다리다가 아무것도 못 하고 멈춰버리는 문제입니다. 이로 인해 시스템이 응답하지 않는 상태가 될 수 있습니다.
🇺🇸 원문 (English)
In the Linux kernel, the following vulnerability has been resolved:
ublk: fix deadlock when reading partition table
When one process(such as udev) opens ublk block device (e.g., to read
the partition table via bdev_open()), a deadlock[1] can occur:
1. bdev_open() grabs disk->open_mutex
2. The process issues read I/O to ublk backend to read partition table
3. In __ublk_complete_rq(), blk_update_request() or blk_mq_end_request()
runs bio->bi_end_io() callbacks
4. If this triggers fput() on file descriptor of ublk block device, the
work may be deferred to current task's task work (see fput() implementation)
5. This eventually calls blkdev_release() from the same context
6. blkdev_release() tries to grab disk->open_mutex again
7. Deadlock: same task waiting for a mutex it already holds
The fix is to run blk_update_request() and blk_mq_end_request() with bottom
halves disabled. This forces blkdev_release() to run in kernel work-queue
context instead of current task work context, and allows ublk server to make
forward progress, and avoids the deadlock.
[axboe: rewrite comment in ublk]
📍 영향받는 시스템
ublk 기능을 사용하는 Linux 커널 버전
⚔️ 공격 벡터
로컬 프로세스(예: udev)가 ublk 블록 장치를 열고 파티션 테이블을 읽는 동작을 유도하여 발생
🛡️ 대응 방법
ublk 관련 데드락 수정 패치가 적용된 최신 Linux 커널로 업데이트
🔧 검증 코드
출력된 커널 버전이 ublk 데드락 수정 패치가 포함된 최신 버전인지 확인