🇰🇷 한글 설명
Linux 커널의 bpf_iter_bits_new() 함수에서 nr_words 값의 유효성을 검사하지 않아 발생하는 취약점입니다. nr_words 값이 특정 조건에서 곱셈 오버플로우를 일으켜 nr_bits 값이 잘못 계산될 수 있으며, 이로 인해 스택 손상(stack corruption)이 발생할 수 있습니다.
💡 쉬운 설명
리눅스 운영체제의 특정 기능에서 숫자를 계산할 때 오류가 발생하여 시스템의 중요한 메모리 영역을 망가뜨릴 수 있는 문제입니다. 공격자가 이를 악용하면 시스템을 중단시키거나 권한을 탈취할 위험이 있습니다.
🇺🇸 원문 (English)
In the Linux kernel, the following vulnerability has been resolved:
bpf: Check the validity of nr_words in bpf_iter_bits_new()
Check the validity of nr_words in bpf_iter_bits_new(). Without this
check, when multiplication overflow occurs for nr_bits (e.g., when
nr_words = 0x0400-0001, nr_bits becomes 64), stack corruption may occur
due to bpf_probe_read_kernel_common(..., nr_bytes = 0x2000-0008).
Fix it by limiting the maximum value of nr_words to 511. The value is
derived from the current implementation of BPF memory allocator. To
ensure compatibility if the BPF memory allocator's size limitation
changes in the future, use the helper bpf_mem_alloc_check_size() to
check whether nr_bytes is too larger. And return -E2BIG instead of
-ENOMEM for oversized nr_bytes.
📍 영향받는 시스템
nr_words 검증 로직이 포함되지 않은 이전 버전의 Linux Kernel (BPF 기능 사용 시)
⚔️ 공격 벡터
조작된 nr_words 값을 전달하여 BPF 프로그램 실행 시 메모리 오버플로우 유도
🛡️ 대응 방법
nr_words의 최대값을 511로 제한하고 bpf_mem_alloc_check_size()를 사용하는 최신 커널 패치 적용
🔧 검증 코드
출력된 커널 버전이 해당 취약점이 수정된 최신 보안 패치 버전인지 배포판 보안 공지를 통해 확인하십시오.