🇰🇷 한글 설명
Linux 커널의 BPF 인터프리터에서 BPF_ADDR_PERCPU 명령어를 처리할 때 오프셋 값을 무시하여 발생하는 취약점입니다. 이로 인해 인터프리터가 잘못된 메모리 주소에 접근하게 되어 커널 모드에서 페이지 폴트(Page Fault) 및 시스템 오류(Oops)가 발생할 수 있습니다.
💡 쉬운 설명
리눅스 커널의 특정 기능을 실행할 때 계산 방식의 오류로 인해 컴퓨터가 잘못된 메모리 주소를 읽으려다 멈추는 현상입니다. 이 오류가 발생하면 시스템이 갑자기 꺼지거나 오류 메시지를 내뱉으며 불안정해질 수 있습니다.
🇺🇸 원문 (English)
In the Linux kernel, the following vulnerability has been resolved:
bpf: Disallow interpreter fallback for BPF_ADDR_PERCPU insn
The BPF_MOV64_PERCPU_REG insn requires JIT to emit native code to for
'dst_reg = src_reg + <percpu_base_off>'.
However, the interpreter ignores the 'off' at its ALU64_MOV_X label.
The 'off' indicates the insn is BPF_MOV64_PERCPU_REG insn. Then, when
the interpreter loads memory from the register, it will hit a page
fault.
[ 2.545572] BUG: unable to handle page fault for address: ffffffffacaaf034
[ 2.546485] #PF: supervisor read access in kernel mode
[ 2.547167] #PF: error_code(0x0000) - not-present page
[ 2.547850] PGD 134e63067 P4D 134e63067 PUD 134e64063 PMD 10021c063 PTE 800ffffeca550062
[ 2.548912] Oops: Oops: 0000 [#1] SMP PTI
Set jit_required as true in order to disallow interpreter fallback in
core.c::__bpf_prog_select_runtime(), if any BPF_ADDR_PERCPU insn is
patched to the prog.
BTW, rename the helper bpf_map_supports_cpu_flags() to
bpf_map_is_percpu_map().
📍 영향받는 시스템
BPF(Berkeley Packet Filter) 기능을 사용하는 Linux Kernel (JIT 컴파일러를 사용하지 않고 인터프리터로 폴백하는 환경)
⚔️ 공격 벡터
특수하게 조작된 BPF 프로그램을 로드하여 커널 인터프리터의 메모리 접근 오류를 유도함
🛡️ 대응 방법
커널 패치를 적용하여 BPF_ADDR_PERCPU 명령어가 포함된 경우 인터프리터 대신 JIT 컴파일러 사용을 강제하도록 업데이트함
🔧 검증 코드
출력된 커널 버전이 해당 취약점이 해결된 최신 패치 버전인지 확인합니다.