🇰🇷 한글 설명
Linux 커널의 BPF 구현에서 per-VMA 락을 유지한 채 BPF 프로그램이 실행될 때 락 순서 불일치로 인한 데드락 문제가 발생할 수 있습니다. 이를 해결하기 위해 VMA 정보를 복사하여 스냅샷을 생성한 뒤 락을 해제하도록 수정되었습니다.
💡 쉬운 설명
컴퓨터의 핵심 운영체제인 리눅스에서 특정 작업이 서로의 자원을 기다리며 멈춰버리는 '데드락' 현상이 발생할 수 있는 결함입니다. 데이터를 안전하게 복사해서 사용하는 방식으로 수정하여 시스템이 멈추는 것을 방지했습니다.
🇺🇸 원문 (English)
In the Linux kernel, the following vulnerability has been resolved:
bpf: return VMA snapshot from task_vma iterator
Holding the per-VMA lock across the BPF program body creates a lock
ordering problem when helpers acquire locks that depend on mmap_lock:
vm_lock -> i_rwsem -> mmap_lock -> vm_lock
Snapshot the VMA under the per-VMA lock in _next() via memcpy(), then
drop the lock before returning. The BPF program accesses only the
snapshot.
The verifier only trusts vm_mm and vm_file pointers (see
BTF_TYPE_SAFE_TRUSTED_OR_NULL in verifier.c). vm_file is reference-
counted with get_file() under the lock and released via fput() on the
next iteration or in _destroy(). vm_mm is already correct because
lock_vma_under_rcu() verifies vma->vm_mm == mm. All other pointers
are left as-is by memcpy() since the verifier treats them as untrusted.
📍 영향받는 시스템
Linux Kernel (BPF 기능이 활성화된 버전)
⚔️ 공격 벡터
특정 조건에서 BPF 프로그램을 실행하여 커널 내 락 순서 문제를 유도함으로써 시스템 데드락 유발
🛡️ 대응 방법
해당 취약점이 해결된 최신 버전의 Linux 커널로 업데이트
🔧 검증 코드
출력된 커널 버전이 취약점이 패치된 최신 릴리스 버전인지 확인