🇰🇷 한글 설명
Linux 커널의 ext4 파일 시스템에서 EXT4_IOC_MOVE_EXT ioctl 호출 시 기증자 파일의 슈퍼블록 검증이 늦게 이루어지는 취약점입니다. 이로 인해 서로 다른 파일 시스템(예: overlayfs) 간의 작업 시 교착 상태(Deadlock)가 발생하여 시스템이 멈출 수 있습니다.
💡 쉬운 설명
서로 다른 저장 공간에 있는 파일들을 옮기려고 할 때, 시스템이 이를 미리 확인하지 못해 서로 자원을 기다리며 멈춰버리는 현상이 발생할 수 있습니다. 이 문제는 시스템 전체를 응답 불능 상태로 만들 수 있는 잠재적 위험이 있습니다.
🇺🇸 원문 (English)
In the Linux kernel, the following vulnerability has been resolved:
ext4: validate donor file superblock early in EXT4_IOC_MOVE_EXT
Reject the EXT4_IOC_MOVE_EXT ioctl early if the donor file does not
belong to the same superblock as the original file. Currently, this
validation is performed inside ext4_move_extents() by
mext_check_validity(), but only after lock_two_nondirectories() has
already acquired the inode locks. When the donor fd refers to a file
on a different filesystem (e.g., overlayfs), this late validation
creates a circular lock dependency:
CPU0 (overlayfs write) CPU1 (ext4 ioctl)
---- ----
inode_lock(ovl_inode)
mnt_want_write_file(filp)
sb_start_write(ext4_sb) [sb_writers]
backing_file_write_iter()
vfs_iter_write(real_file)
file_start_write(real_file)
sb_start_write(ext4_sb) [blocked by freeze]
lock_two_nondirectories()
inode_lock(ovl_inode) [blocked]
With a concurrent freeze operation holding sb_writers write side, this
forms a deadlock cycle: CPU0 waits for freeze to complete, freeze waits
for CPU1's sb_writers reader to exit, CPU1 waits for CPU0's inode lock.
Since EXT4_IOC_MOVE_EXT exchanges physical extents between two files,
it fundamentally requires both files to reside on the same ext4
filesystem. Moving the superblock check before any lock acquisition
is both semantically correct and eliminates the circular dependency
by ensuring that cross-filesystem donor fds are rejected before
sb_writers or inode locks are taken.
📍 영향받는 시스템
Linux kernel (ext4 filesystem 사용 시스템)
⚔️ 공격 벡터
서로 다른 파일 시스템 간에 EXT4_IOC_MOVE_EXT ioctl을 호출하여 교착 상태 유도
🛡️ 대응 방법
Linux 커널을 최신 보안 패치가 적용된 버전으로 업데이트
🔧 검증 코드
출력된 커널 버전이 해당 취약점이 수정된 패치 버전 이후인지 확인