🇰🇷 한글 설명
Linux 커널의 BPF(Berkeley Packet Filter) 구성 요소에서 NULL 포인터 역참조 취약점이 발견되었습니다. bpf_selem_unlink_nofail() 함수가 요소를 제거하기 전 smap를 NULL로 설정함에 따라, 동시에 실행되는 RCU 리더가 NULL 상태의 포인터에 접근하여 시스템 충돌을 일으킬 수 있습니다.
💡 쉬운 설명
컴퓨터의 핵심 운영체제인 리눅스 내부에서 데이터가 삭제되는 도중, 다른 프로그램이 삭제된 데이터를 참조하려고 시도하면서 시스템이 멈추거나 오류가 발생하는 문제입니다. 이는 데이터 관리 과정에서의 순서 불일치로 인해 발생합니다.
🇺🇸 원문 (English)
In the Linux kernel, the following vulnerability has been resolved:
bpf: Fix NULL pointer dereference in bpf_sk_storage_clone and diag paths
bpf_selem_unlink_nofail() sets SDATA(selem)->smap to NULL before
removing the selem from the storage hlist. A concurrent RCU reader in
bpf_sk_storage_clone() can observe the selem still on the list with
smap already NULL, causing a NULL pointer dereference.
general protection fault, probably for non-canonical address 0xdffffc000000000a:
KASAN: null-ptr-deref in range [0x0000000000000050-0x0000000000000057]
RIP: 0010:bpf_sk_storage_clone+0x1cd/0xaa0 net/core/bpf_sk_storage.c:174
Call Trace:
<IRQ>
sk_clone+0xfed/0x1980 net/core/sock.c:2591
inet_csk_clone_lock+0x30/0x760 net/ipv4/inet_connection_sock.c:1222
tcp_create_openreq_child+0x35/0x2680 net/ipv4/tcp_minisocks.c:571
tcp_v4_syn_recv_sock+0x123/0xf90 net/ipv4/tcp_ipv4.c:1729
tcp_check_req+0x8e1/0x2580 include/net/tcp.h:855
tcp_v4_rcv+0x1845/0x3b80 net/ipv4/tcp_ipv4.c:2347
Add a NULL check for smap in bpf_sk_storage_clone().
bpf_sk_storage_diag_put_all() has the same issue. Add a NULL check
and pass the validated smap directly to diag_get(), which is refactored
to take smap as a parameter instead of reading it internally.
bpf_sk_storage_diag_put() uses diag->maps[i] which is always valid
under its refcount, so diag->maps[i] is passed directly to diag_get().
📍 영향받는 시스템
Linux Kernel (BPF 관련 기능이 활성화된 모든 버전)
⚔️ 공격 벡터
동시성(Concurrency)을 이용한 레이스 컨디션(Race Condition) 공격을 통해 커널 패닉 유도
🛡️ 대응 방법
커널 업데이트를 통해 bpf_sk_storage_clone 및 diag 경로에 NULL 체크 로직이 포함된 최신 패치를 적용해야 합니다.
🔧 검증 코드
출력된 커널 버전을 확인하여 해당 취약점이 해결된 최신 보안 패치 버전인지 확인합니다.