🇰🇷 한글 설명
Linux 커널의 BPF 검증기(verifier)에서 JSET 명령 실행 후 tnum을 정제할 때 범위 정보를 누락하는 취약점입니다. 이로 인해 도달할 수 없는 경로에서 레지스터 경계 값이 불일치하게 되어 커널 경고가 발생할 수 있습니다.
💡 쉬운 설명
리눅스 운영체제의 보안 검사 프로그램이 특정 계산 과정을 처리할 때 숫자의 범위를 잘못 계산하는 오류입니다. 이 오류로 인해 시스템이 예상치 못한 상태에 빠져 경고를 발생시킬 수 있습니다.
🇺🇸 원문 (English)
In the Linux kernel, the following vulnerability has been resolved:
bpf: Forget ranges when refining tnum after JSET
Syzbot reported a kernel warning due to a range invariant violation on
the following BPF program.
0: call bpf_get_netns_cookie
1: if r0 == 0 goto <exit>
2: if r0 & Oxffffffff goto <exit>
The issue is on the path where we fall through both jumps.
That path is unreachable at runtime: after insn 1, we know r0 != 0, but
with the sign extension on the jset, we would only fallthrough insn 2
if r0 == 0. Unfortunately, is_branch_taken() isn't currently able to
figure this out, so the verifier walks all branches. The verifier then
refines the register bounds using the second condition and we end
up with inconsistent bounds on this unreachable path:
1: if r0 == 0 goto <exit>
r0: u64=[0x1, 0xffffffffffffffff] var_off=(0, 0xffffffffffffffff)
2: if r0 & 0xffffffff goto <exit>
r0 before reg_bounds_sync: u64=[0x1, 0xffffffffffffffff] var_off=(0, 0)
r0 after reg_bounds_sync: u64=[0x1, 0] var_off=(0, 0)
Improving the range refinement for JSET to cover all cases is tricky. We
also don't expect many users to rely on JSET given LLVM doesn't generate
those instructions. So instead of improving the range refinement for
JSETs, Eduard suggested we forget the ranges whenever we're narrowing
tnums after a JSET. This patch implements that approach.
📍 영향받는 시스템
Linux Kernel (BPF verifier 관련 버전)
⚔️ 공격 벡터
특수하게 조작된 BPF 프로그램을 로드하여 커널 검증기의 논리적 오류를 유도
🛡️ 대응 방법
해당 취약점이 수정된 최신 버전의 Linux 커널로 업데이트
🔧 검증 코드
현재 실행 중인 커널 버전을 확인하여 수정된 패치가 적용된 버전인지 확인