🇰🇷 한글 설명
Linux 커널의 bpf 구성 요소에서 irq_work 경로를 통한 mmap_lock 누수 취약점이 발견되었습니다. stack_map_get_build_id_offset()와 bpf_find_vma() 함수가 동일한 mmap_unlock_work를 재사용하는 과정에서 경합 조건이 발생하여, 읽기 잠금(read lock)이 해제되지 않고 누수될 수 있습니다. 이로 인해 exit_mmap() 프로세스가 차단될 수 있습니다.
💡 쉬운 설명
컴퓨터의 메모리를 관리하는 과정에서 잠금 장치가 제대로 풀리지 않고 계속 쌓이는 버그가 있습니다. 이 문제가 지속되면 시스템이 메모리 관리 작업을 완료하지 못해 성능이 저하되거나 멈출 수 있습니다.
🇺🇸 원문 (English)
In the Linux kernel, the following vulnerability has been resolved:
bpf: Fix mmap_lock leak in irq_work path
stack_map_get_build_id_offset() introduced a per-CPU irq_work to defer
mmap_read_unlock() from NMI context, and bpf_find_vma() later reused the
same mmap_unlock_work. Both callers only check whether the work is busy
before taking mmap_lock, so a nested caller can reuse the slot before the
first caller queues it. Two read locks may then be acquired while only one
deferred unlock runs, leaking a read lock and blocking exit_mmap().
Reserve the per-CPU slot before mmap_read_trylock(). Use the same wrapper
in stackmap and bpf_find_vma() so both callers release the reservation on
trylock failure. Keep rejecting the slot while the irq_work remains busy.
Release it after the irq_work callback unlocks the mm.
📍 영향받는 시스템
Linux kernel (bpf 관련 기능이 활성화된 버전)
⚔️ 공격 벡터
로컬 공격자가 특정 BPF 시스템 호출을 반복적으로 유도하여 커널의 mmap_lock을 고갈시킴 (Local Denial of Service)
🛡️ 대응 방법
커널 패치를 적용하여 mmap_lock 예약 로직을 수정하고 irq_work 재사용 문제를 해결해야 합니다.
🔧 검증 코드
현재 실행 중인 커널 버전을 확인하여 해당 취약점이 수정된 최신 패치 버전인지 확인합니다.