🇰🇷 한글 설명
Linux 커널의 BPF 검증 로직에서 PTR_TO_BUF 타입 포인터에 대한 null 체크를 건너뛸 수 있습니다. Map iterator의 ctx->key와 ctx->value가 stop callback에서 NULL이 될 수 있지만 검증되지 않아 커널이 NULL을 역참조하면서 크래시가 발생합니다.
💡 쉬운 설명
Linux 커널이 특정 프로그램을 실행할 때 없는 메모리 주소를 읽으려고 시도합니다. 이로 인해 커널이 갑자기 중단될 수 있습니다.
🇺🇸 원문 (English)
In the Linux kernel, the following vulnerability has been resolved:
bpf: reject direct access to nullable PTR_TO_BUF pointers
check_mem_access() matches PTR_TO_BUF via base_type() which strips
PTR_MAYBE_NULL, allowing direct dereference without a null check.
Map iterator ctx->key and ctx->value are PTR_TO_BUF | PTR_MAYBE_NULL.
On stop callbacks these are NULL, causing a kernel NULL dereference.
Add a type_may_be_null() guard to the PTR_TO_BUF branch, matching the
existing PTR_TO_BTF_ID pattern.
📍 영향받는 시스템
Linux 커널 5.10 이상 (배포판별로 패치 상황 다름)
⚔️ 공격 벡터
BPF 프로그램을 로드하고 Map iterator 관련 코드 실행
🛡️ 대응 방법
Linux 커널을 최신 패치 버전으로 업데이트
🔧 검증 코드
커널 버전 확인 후 type_may_be_null 함수가 커널 소스에 있으면 패치가 적용됨
uname -r | grep -E '[0-9]+\.[0-9]+' && grep -r 'type_may_be_null' /usr/src/linux 2>/dev/null || echo 'Kernel headers not found'