🇰🇷 한글 설명
Linux 커널의 BPF 로컬 스토리지 삭제 과정에서 NMI(Non-Maskable Interrupt) 또는 재진입(reentrant) 상황 발생 시 데드락(Deadlock)이 발생할 수 있는 취약점입니다. 이 취약점은 kfree_rcu() 등을 통해 메모리 해제를 지연시키는 과정에서 시스템이 멈추는 현상을 유발할 수 있습니다.
💡 쉬운 설명
컴퓨터의 아주 중요한 작업 중에 갑자기 다른 작업이 끼어들면 시스템이 서로를 기다리다가 멈춰버리는 현상이 발생할 수 있습니다. 이 문제는 특정 메모리 정리 작업이 잘못된 타이밍에 실행될 때 발생합니다.
🇺🇸 원문 (English)
In the Linux kernel, the following vulnerability has been resolved:
bpf: Do not allow deleting local storage in NMI
Currently, local storage may deadlock when deferring freeing selem or
local storage through kfree_rcu(), call_rcu() or call_rcu_tasks_trace()
in NMI or reentrant. Since deleting selem in NMI is an unlikely use
case, partially mitigate it by returning error when calling from
bpf_xxx_storage_delete() helpers in NMI. Note that, it is still possible
to deadlock through reentrant. A full mitigation requires returning
error when irqs_disabled() is true, which, however is too heavy-handed
for bpf_xxx_storage_delete().
The long-term solution requires _nolock versions of call_rcu. Another
possible solution is to defer the free through irq_work [0], but it
would grow the size of selem, which is non-ideal.
The check is only needed in bpf_selem_unlink(), which is used by helpers
and syscalls. bpf_selem_unlink_nofail() is fine as it is called during
map and owner tear down that never run in NMI or reentrant.
[0] https://lore.kernel.org/bpf/
[email protected]/
📍 영향받는 시스템
Linux Kernel (BPF local storage 관련 기능 사용 시스템)
⚔️ 공격 벡터
NMI 또는 재진입이 가능한 환경에서 BPF 로컬 스토리지 삭제 헬퍼 함수를 호출하여 데드락 유도
🛡️ 대응 방법
최신 보안 패치가 적용된 Linux 커널로 업데이트
🔧 검증 코드
출력된 커널 버전이 해당 취약점이 해결된 패치 버전 이후인지 확인