🇰🇷 한글 설명
Linux 커널의 ext4 파일 시스템에서 ext4_ext_migrate 함수 호출 시 s_writepages_rwsem과 sb_internal 간의 순환 잠금 의존성으로 인해 데드락(Deadlock)이 발생할 수 있는 취약점입니다. iput(tmp_inode) 호출 시점을 조정하여 잠금 순서를 올바르게 수정함으로써 이 문제를 해결했습니다.
💡 쉬운 설명
컴퓨터의 파일 시스템이 데이터를 처리하는 과정에서 두 가지 작업이 서로 상대방의 작업이 끝나기만을 기다리며 멈춰버리는 현상이 발생할 수 있습니다. 이로 인해 시스템이 응답하지 않거나 멈출 수 있는 문제입니다.
🇺🇸 원문 (English)
In the Linux kernel, the following vulnerability has been resolved:
ext4: fix circular lock dependency in ext4_ext_migrate
Move iput(tmp_inode) after ext4_writepages_up_write() to avoid a
circular lock dependency between s_writepages_rwsem and sb_internal
(freeze protection).
The deadlock scenario:
CPU0 (EXT4_IOC_MIGRATE) CPU1 (orphan cleanup during mount)
---- ----
ext4_ext_migrate()
ext4_writepages_down_write()
s_writepages_rwsem (write)
ext4_evict_inode()
sb_start_intwrite() [sb_internal]
...
ext4_writepages()
s_writepages_rwsem (read) [BLOCKED]
iput(tmp_inode)
ext4_evict_inode()
sb_start_intwrite() [BLOCKED]
The tmp_inode is a temporary inode with nlink=0 created solely for
building the extent tree. Its eviction does not require
s_writepages_rwsem protection, so deferring iput() until after
releasing the rwsem is safe.
📍 영향받는 시스템
ext4 파일 시스템을 사용하는 Linux 커널 버전
⚔️ 공격 벡터
로컬 사용자가 특정 파일 시스템 작업(EXT4_IOC_MIGRATE)을 유도하여 시스템 데드락을 발생시킬 수 있음
🛡️ 대응 방법
ext4 잠금 의존성 수정 패치가 적용된 최신 Linux 커널로 업데이트
🔧 검증 코드
출력된 커널 버전이 해당 취약점이 수정된 패치 버전 이후인지 확인