🇰🇷 한글 설명
Linux 커널의 BPF 구성 요소에서 update_effective_progs 함수가 실패할 때 잘못된 prog->stats에 접근하여 발생하는 메모리 오류 취약점입니다. 결함 주입(fault injection) 상황에서 특정 프로그램이 dummy_bpf_prog로 교체된 후, 소프트 인터럽트(softirq)가 실행되면서 유효하지 않은 메모리 영역에 접근하게 됩니다.
💡 쉬운 설명
리눅스 시스템의 특정 기능을 업데이트하는 도중 오류가 발생하면, 컴퓨터가 잘못된 메모리 주소를 읽으려고 시도하여 시스템이 불안정해질 수 있습니다. 이는 시스템이 예상치 못한 동작을 하거나 멈추게 만드는 원인이 될 수 있습니다.
🇺🇸 원문 (English)
In the Linux kernel, the following vulnerability has been resolved:
bpf: Fix invalid prog->stats access when update_effective_progs fails
Syzkaller triggers an invalid memory access issue following fault
injection in update_effective_progs. The issue can be described as
follows:
__cgroup_bpf_detach
update_effective_progs
compute_effective_progs
bpf_prog_array_alloc <-- fault inject
purge_effective_progs
/* change to dummy_bpf_prog */
array->items[index] = &dummy_bpf_prog.prog
---softirq start---
__do_softirq
...
__cgroup_bpf_run_filter_skb
__bpf_prog_run_save_cb
bpf_prog_run
stats = this_cpu_ptr(prog->stats)
/* invalid memory access */
flags = u64_stats_update_begin_irqsave(&stats->syncp)
---softirq end---
static_branch_dec(&cgroup_bpf_enabled_key[atype])
The reason is that fault injection caused update_effective_progs to fail
and then changed the original prog into dummy_bpf_prog.prog in
purge_effective_progs. Then a softirq came, and accessing the members of
dummy_bpf_prog.prog in the softirq triggers invalid mem access.
To fix it, skip updating stats when stats is NULL.
📍 영향받는 시스템
Linux kernel (BPF 관련 기능이 활성화된 버전)
⚔️ 공격 벡터
결함 주입(Fault Injection)을 통한 메모리 오류 유도 및 소프트 인터럽트 실행
🛡️ 대응 방법
Linux 커널을 최신 보안 패치가 적용된 버전으로 업데이트하여 stats가 NULL인 경우 업데이트를 건너뛰도록 수정합니다.
🔧 검증 코드
출력된 커널 버전을 확인하여 해당 취약점이 해결된 최신 패치 버전인지 확인합니다.