🇰🇷 한글 설명
Linux 커널의 BPF dev_map_redirect_multi() 함수에서 RCU 보호 하에 해시 버킷을 순회할 때 적절한 RCU 안전 반복자를 사용하지 않는 취약점이 발견되었습니다. 이로 인해 ARM64나 POWER와 같은 약한 메모리 순서 아키텍처에서 데이터 경합이 발생하여 시스템 불안정성을 초래할 수 있습니다.
💡 쉬운 설명
컴퓨터의 핵심 운영체제인 리눅스 내부에서 데이터를 읽고 쓰는 과정이 서로 충돌하여 시스템이 오작동할 수 있는 문제입니다. 특히 특정 하드웨어 구조에서 데이터가 깨지거나 시스템이 멈출 위험이 있습니다.
🇺🇸 원문 (English)
In the Linux kernel, the following vulnerability has been resolved:
bpf: Use RCU-safe iteration in dev_map_redirect_multi() SKB path
The DEVMAP_HASH branch in dev_map_redirect_multi() uses
hlist_for_each_entry_safe() to iterate hash buckets, but this function
runs under RCU protection (called from xdp_do_generic_redirect_map()
in softirq context). Concurrent writers (__dev_map_hash_update_elem,
dev_map_hash_delete_elem) modify the list using RCU primitives
(hlist_add_head_rcu, hlist_del_rcu).
hlist_for_each_entry_safe() performs plain pointer dereferences without
rcu_dereference(), missing the acquire barrier needed to pair with
writers' rcu_assign_pointer(). On weakly-ordered architectures (ARM64,
POWER), a reader can observe a partially-constructed node. It also
defeats CONFIG_PROVE_RCU lockdep validation and KCSAN data-race
detection.
Replace with hlist_for_each_entry_rcu() using rcu_read_lock_bh_held()
as the lockdep condition, consistent with the rcu_dereference_check()
used in the DEVMAP (non-hash) branch of the same functions. Also fix
the same incorrect lockdep_is_held(&dtab->index_lock) condition in
dev_map_enqueue_multi(), where the lock is not held either.
📍 영향받는 시스템
Linux Kernel (BPF/dev_map 관련 모듈 사용 시스템)
⚔️ 공격 벡터
로컬 공격자가 특수하게 조작된 BPF 프로그램을 실행하여 커널 내 데이터 경합 유도
🛡️ 대응 방법
리눅스 커널을 최신 보안 패치가 적용된 버전으로 업데이트하여 hlist_for_each_entry_rcu()가 적용된 버전 사용
🔧 검증 코드
출력된 커널 버전이 해당 취약점이 수정된 패치 버전 이후인지 확인