🇰🇷 한글 설명
Linux 커널의 Btrfs 파일 시스템에서 inode 제거와 캐싱 간의 레이스 컨디션으로 인해 서브볼륨 삭제 시 시스템이 멈추는 취약점입니다. inode가 xarray에서 누락되는 상태가 발생하면 delayed_node 처리 과정에서 무한 루프가 발생하여 소프트 락업(soft lockup) 현상이 나타날 수 있습니다.
💡 쉬운 설명
파일을 삭제하는 과정에서 두 가지 작업이 동시에 일어나 데이터 관리 목록이 꼬이는 문제입니다. 이로 인해 컴퓨터가 특정 작업을 수행할 때 무한 루프에 빠져 시스템이 멈출 수 있습니다.
🇺🇸 원문 (English)
In the Linux kernel, the following vulnerability has been resolved:
btrfs: fix subvolume deletion lockup caused by inodes xarray race
There is a race condition between inode eviction and inode caching that
can cause a live struct btrfs_inode to be missing from the root->inodes
xarray. Specifically, there is a window during evict() between the inode
being unhashed and deleted from the xarray. If btrfs_iget() is called
for the same inode in that window, it will be recreated and inserted
into the xarray, but then eviction will delete the new entry, leaving
nothing in the xarray:
Thread 1 Thread 2
---------------------------------------------------------------
evict()
remove_inode_hash()
btrfs_iget_path()
btrfs_iget_locked()
btrfs_read_locked_inode()
btrfs_add_inode_to_root()
destroy_inode()
btrfs_destroy_inode()
btrfs_del_inode_from_root()
__xa_erase
In turn, this can cause issues for subvolume deletion. Specifically, if
an inode is in this lost state, and all other inodes are evicted, then
btrfs_del_inode_from_root() will call btrfs_add_dead_root() prematurely.
If the lost inode has a delayed_node attached to it, then when
btrfs_clean_one_deleted_snapshot() calls btrfs_kill_all_delayed_nodes(),
it will loop forever because the delayed_nodes xarray will never become
empty (unless memory pressure forces the inode out). We saw this
manifest as soft lockups in production.
Fix it by only deleting the xarray entry if it matches the given inode
(using __xa_cmpxchg()).
📍 영향받는 시스템
Btrfs 파일 시스템을 사용하는 Linux 커널 버전
⚔️ 공격 벡터
로컬 사용자가 특정 파일 시스템 작업(서브볼륨 삭제 등)을 유도하여 레이스 컨디션을 발생시킴
🛡️ 대응 방법
해당 취약점이 수정된 최신 Linux 커널로 업데이트
🔧 검증 코드
출력된 커널 버전이 해당 취약점이 패치된 버전인지 배포판 보안 공지를 통해 확인