🇰🇷 한글 설명
Linux 커널의 BPF(Berkeley Packet Filter) 구현 중 bpf_skb_check_mtu 헬퍼 함수에서 skb->transport_header 설정 여부를 확인하지 않아 발생하는 취약점입니다. BPF_MTU_CHK_SEGS 플래그가 사용될 때 전송 헤더가 설정되어 있지 않으면 커널 경고(WARN_ON_ONCE)가 발생할 수 있습니다.
💡 쉬운 설명
리눅스 커널의 네트워크 데이터 처리 과정에서 특정 설정이 누락되었을 때 시스템이 경고를 발생시키는 문제입니다. 이는 시스템의 안정성에 영향을 줄 수 있는 소프트웨어 로직 오류입니다.
🇺🇸 원문 (English)
In the Linux kernel, the following vulnerability has been resolved:
bpf: Check skb->transport_header is set in bpf_skb_check_mtu
The bpf_skb_check_mtu helper needs to use skb->transport_header when
the BPF_MTU_CHK_SEGS flag is used:
bpf_skb_check_mtu(skb, ifindex, &mtu_len, 0, BPF_MTU_CHK_SEGS)
The transport_header is not always set. There is a WARN_ON_ONCE
report when CONFIG_DEBUG_NET is enabled + skb->gso_size is set +
bpf_prog_test_run is used:
WARNING: CPU: 1 PID: 2216 at ./include/linux/skbuff.h:3071
skb_gso_validate_network_len
bpf_skb_check_mtu
bpf_prog_3920e25740a41171_tc_chk_segs_flag # A test in the next patch
bpf_test_run
bpf_prog_test_run_skb
For a normal ingress skb (not test_run), skb_reset_transport_header
is performed but there is plan to avoid setting it as described in
commit 2170a1f09148 ("net: no longer reset transport_header in __netif_receive_skb_core()").
This patch fixes the bpf helper by checking
skb_transport_header_was_set(). The check is done just before
skb->transport_header is used, to avoid breaking the existing bpf prog.
The WARN_ON_ONCE is limited to bpf_prog_test_run, so targeting bpf-next.
📍 영향받는 시스템
Linux kernel (bpf-next 및 관련 네트워크 스택 사용 버전)
⚔️ 공격 벡터
로컬 공격자가 bpf_prog_test_run을 사용하여 특정 조건의 BPF 프로그램을 실행함으로써 발생
🛡️ 대응 방법
커널 패치를 적용하여 bpf_skb_check_mtu 함수 내에 skb_transport_header_was_set() 체크 로직을 포함해야 함
🔧 검증 코드
출력된 커널 버전이 해당 취약점이 수정된 최신 패치 버전인지 확인하십시오.