🇰🇷 한글 설명
Linux 커널의 BPF 구현에서 JIT 컴파일러가 비활성화되었을 때, 인라인 헬퍼를 사용하는 프로그램이 인터프리터로 실행되면서 잘못된 메모리 주소로 점프하여 커널 패닉을 유발하는 취약점입니다. 이를 해결하기 위해 JIT가 필요한 프로그램에 대해 JIT 미사용 시 실행을 거부하도록 수정되었습니다.
💡 쉬운 설명
특수한 방식으로 작동하는 프로그램이 JIT라는 가속 기능을 사용하지 못할 경우, 시스템이 잘못된 명령을 수행하다가 갑자기 멈추거나 꺼질 수 있는 문제입니다. 시스템이 안전하게 해당 프로그램을 거부하도록 하여 충돌을 방지합니다.
🇺🇸 원문 (English)
In the Linux kernel, the following vulnerability has been resolved:
bpf: Reject programs with inlined helpers if JIT is not available
When an architecture (such as LoongArch, ARM64, and RISC-V) implements
bpf_jit_inlines_helper_call(), the verifier skips rewriting the helper
call offset (insn->imm) in bpf_do_misc_fixups(). This is because the
helper is expected to be inlined by the JIT compiler later. Therefore,
insn->imm remains as the raw helper enum ID.
However, if JIT is disabled at runtime (net.core.bpf_jit_enable=0) or
if JIT compilation fails dynamically (e.g., due to OOM), the program
falls back to the BPF interpreter.
When the interpreter executes (__bpf_call_base + insn->imm) with the
unpatched raw ID, it jumps into an invalid address space, triggering
an instruction alignment fault or a kernel panic.
Although these helpers have valid C implementations in the kernel, the
omission of offset rewriting makes runtime interpreter fallback fatal.
Fix this by setting 'prog->jit_required = 1' when helper call rewriting
is skipped for JIT inlining. This ensures that such programs are safely
rejected if JIT is not available, preventing the runtime kernel panic.
📍 영향받는 시스템
JIT 컴파일러를 사용하는 LoongArch, ARM64, RISC-V 아키텍처 기반의 Linux 커널
⚔️ 공격 벡터
JIT가 비활성화된 환경에서 인라인 헬퍼를 포함한 악의적인 BPF 프로그램을 로드하여 커널 패닉 유도
🛡️ 대응 방법
Linux 커널을 최신 보안 패치가 적용된 버전으로 업데이트
🔧 검증 코드
출력된 커널 버전이 해당 취약점이 해결된 패치 버전 이후인지 확인