🇰🇷 한글 설명
Linux 커널의 BPF 기능 중 bpf_tcp_*_syncookie 함수에서 소켓 상태를 검증하기 전에 프로토콜을 참조하여 발생하는 취약점입니다. sk_state를 먼저 확인하여 해당 소켓이 완전한 소켓인지 검증하지 않을 경우 잘못된 메모리 참조가 발생할 수 있습니다.
💡 쉬운 설명
리눅스 운영체제의 핵심 기능 중 하나에서 소켓의 종류를 제대로 확인하지 않고 정보를 읽으려다 발생하는 오류입니다. 이로 인해 시스템이 불안정해지거나 보안상 문제가 생길 수 있습니다.
🇺🇸 원문 (English)
In the Linux kernel, the following vulnerability has been resolved:
bpf: Check sk_state before sk_protocol in bpf_tcp_*_syncookie
bpf_tcp_gen_syncookie and bpf_tcp_check_syncookie accept a socket pointer
'sk' with argument type ARG_PTR_TO_BTF_ID_SOCK_COMMON. However, they access
sk->sk_protocol without validating whether 'sk' represents a full socket.
Fix this issue by checking sk->sk_state != TCP_LISTEN before inspecting
sk->sk_protocol in both bpf_tcp_gen_syncookie and bpf_tcp_check_syncookie.
Since mini-sockets are never in the TCP_LISTEN state, the condition
short-circuits and prevents dereferencing fullsock-specific fields.
📍 영향받는 시스템
Linux kernel (BPF 관련 기능이 활성화된 시스템)
⚔️ 공격 벡터
조작된 소켓 포인터를 BPF 프로그램에 전달하여 잘못된 메모리 영역에 접근
🛡️ 대응 방법
Linux 커널을 최신 보안 패치가 적용된 버전으로 업데이트
🔧 검증 코드
출력된 커널 버전이 해당 취약점이 해결된 패치 버전 이후인지 확인