🇰🇷 한글 설명
Linux 커널의 BPF 구현에서 bpf_net_context가 없는 상태에서 redirect 헬퍼 함수를 호출할 경우 NULL 포인터 역참조가 발생하여 시스템이 충돌할 수 있는 취약점입니다. 특정 qdisc에 {cls,act}_bpf가 연결된 경우, bpf_redirect()를 직접 호출하거나 TC_ACT_REDIRECT를 반환할 때 커널 패닉이 발생할 수 있습니다.
💡 쉬운 설명
리눅스 운영체제의 네트워크 처리 과정에서 특정 설정이 잘못되었을 때 시스템이 갑자기 멈추거나 꺼질 수 있는 오류입니다. 네트워크 관련 특수 프로그램을 실행할 때 시스템이 예상치 못한 명령을 받으면 혼란에 빠져 충돌하는 현상입니다.
🇺🇸 원문 (English)
In the Linux kernel, the following vulnerability has been resolved:
bpf: Reject redirect helpers without a bpf_net_context
The bpf_redirect*() helpers and skb_do_redirect() obtain the per-task
bpf_redirect_info via bpf_net_ctx_get_ri(), which dereferences the
current->bpf_net_context unconditionally. That context is established
on the paths that run tc BPF such as sch_handle_{ingress,egress}(),
*except* for the case where {cls,act}_bpf was attached to a proper
qdisc. A program running from there reaches the NULL deref in two ways:
* It calls bpf_redirect() directly, which dereferences the context at
the top of the helper:
tc qdisc add dev eth0 root handle 1: red limit 1MB min 10KB max 20KB \
avpkt 1000 burst 100 qevent early_drop block 10
tc filter add block 10 pref 1 bpf obj redirect.o
* It simply returns TC_ACT_REDIRECT without helper call: tcf_qevent_handle()
then dispatches to skb_do_redirect(), which dereferences the context
Rather than extending bpf_net_context management into the qdisc path,
make the redirect helpers refuse to operate when no context exists, and
have tcf_qevent_handle() drop a TC_ACT_REDIRECT verdict instead of
calling skb_do_redirect(). Previous behaviour was a crash, so nothing
regresses by not supporting it.
📍 영향받는 시스템
bpf_net_context 관리가 미흡한 특정 버전의 Linux Kernel
⚔️ 공격 벡터
특정 qdisc에 {cls,act}_bpf가 부착된 환경에서 조작된 BPF 프로그램을 실행하여 NULL 포인터 역참조 유도
🛡️ 대응 방법
해당 취약점이 해결된 최신 버전의 Linux 커널로 업데이트
🔧 검증 코드
출력된 커널 버전이 해당 취약점이 패치된 배포판의 보안 업데이트 버전인지 확인