🇰🇷 한글 설명
Linux 커널의 BPF 검증기(verifier) 내 stacksafe() 함수에서 발생하는 메모리 접근 오류 취약점입니다. 이전 스택 크기보다 현재 스택 크기가 작을 경우, 경계 검사 없이 메모리에 접근하여 커널 크래시를 유발할 수 있습니다.
💡 쉬운 설명
리눅스 운영체제의 핵심 기능 중 하나인 BPF 검사 과정에서 메모리 범위를 잘못 계산하는 오류가 발견되었습니다. 이로 인해 시스템이 갑자기 멈추거나 꺼지는 현상이 발생할 수 있습니다.
🇺🇸 원문 (English)
In the Linux kernel, the following vulnerability has been resolved:
bpf: Fix a kernel verifier crash in stacksafe()
Daniel Hodges reported a kernel verifier crash when playing with sched-ext.
Further investigation shows that the crash is due to invalid memory access
in stacksafe(). More specifically, it is the following code:
if (exact != NOT_EXACT &&
old->stack[spi].slot_type[i % BPF_REG_SIZE] !=
cur->stack[spi].slot_type[i % BPF_REG_SIZE])
return false;
The 'i' iterates old->allocated_stack.
If cur->allocated_stack < old->allocated_stack the out-of-bound
access will happen.
To fix the issue add 'i >= cur->allocated_stack' check such that if
the condition is true, stacksafe() should fail. Otherwise,
cur->stack[spi].slot_type[i % BPF_REG_SIZE] memory access is legal.
📍 영향받는 시스템
sched-ext를 사용하는 Linux kernel (stacksafe() 함수 관련 버전)
⚔️ 공격 벡터
조작된 BPF 프로그램을 실행하여 커널 검증기의 메모리 경계 검사를 우회하고 커널 크래시 유도
🛡️ 대응 방법
해당 취약점이 수정된 최신 버전의 Linux 커널로 업데이트
🔧 검증 코드
출력된 커널 버전이 취약점이 해결된 패치 버전인지 배포판 보안 공지를 통해 확인