🇰🇷 한글 설명
Linux 커널의 BPF TCP 반복자(iterator)에서 배치 재할당 실패 시 소켓 참조가 중복 해제되는 취약점입니다. 재할당 실패 시 소켓 쿠키가 포함된 슬롯을 소켓 포인터로 잘못 참조하여 커널 패닉(Null Pointer Dereference)을 유발할 수 있습니다.
💡 쉬운 설명
컴퓨터의 핵심 시스템인 리눅스 커널에서 데이터를 처리하던 중 메모리 공간이 부족해지면 오류가 발생합니다. 이 오류로 인해 시스템이 갑자기 멈추거나 꺼지는 현상이 발생할 수 있습니다.
🇺🇸 원문 (English)
In the Linux kernel, the following vulnerability has been resolved:
bpf: tcp: fix double sock release on batch realloc
bpf_iter_tcp_batch() releases the current batch via
bpf_iter_tcp_put_batch(), which drops the socket refs and rewrites
each slot with the socket cookie, then grows the batch. cur_sk/end_sk
are kept for bpf_iter_tcp_resume(), but on realloc failure the function
returns ERR_PTR() before resume runs, leaving cur_sk < end_sk over
slots that now hold cookies rather than sock pointers.
bpf_iter_tcp_seq_stop() then calls bpf_iter_tcp_put_batch() again and
dereferences a cookie as a struct sock.
Empty the batch on the failure path so stop() does not release it
again. The sockets were already freed by the first
bpf_iter_tcp_put_batch(), so nothing leaks, and a later read() rescans
the bucket from the start instead of skipping it. The sibling
GFP_NOWAIT failure path still holds real socket references and is left
for stop() to release.
BUG: KASAN: null-ptr-deref in __sock_gen_cookie
Read of size 8 at addr 0000000000000059 by task exploit
...
__sock_gen_cookie (net/core/sock_diag.c:28)
bpf_iter_tcp_put_batch (net/ipv4/tcp_ipv4.c:2918)
bpf_iter_tcp_seq_stop (net/ipv4/tcp_ipv4.c:3270)
bpf_seq_read (kernel/bpf/bpf_iter.c:205)
vfs_read (fs/read_write.c:572)
ksys_read (fs/read_write.c:716)
do_syscall_64
entry_SYSCALL_64_after_hwframe
Kernel panic - not syncing: Fatal exception
📍 영향받는 시스템
Linux Kernel (BPF TCP iterator 관련 기능이 활성화된 버전)
⚔️ 공격 벡터
로컬 사용자가 특수하게 조작된 BPF 시스템 호출을 통해 메모리 재할당 실패를 유도하여 커널 패닉 유발
🛡️ 대응 방법
Linux 커널을 최신 보안 패치가 적용된 버전으로 업데이트하십시오.
🔧 검증 코드
출력된 커널 버전을 확인하여 해당 취약점이 해결된 패치 버전인지 확인하십시오.