🇰🇷 한글 설명
Linux 커널의 arm64 BPF JIT 컴파일러에서 check_imm 함수가 부호 있는 즉시값(immediate)의 범위를 잘못 검증하는 off-by-one 취약점이 발견되었습니다. 이로 인해 허용되지 않는 범위의 값이 전달될 경우, 인코딩 과정에서 부호 비트가 변하여 분기 방향이 반전되는 문제가 발생할 수 있습니다.
💡 쉬운 설명
컴퓨터가 명령어를 처리할 때 숫자의 범위를 확인하는 과정에서 실수로 범위를 너무 넓게 잡은 보안 결함입니다. 이 오류를 이용하면 프로그램의 실행 흐름을 공격자가 의도한 방향으로 뒤바꿀 수 있습니다.
🇺🇸 원문 (English)
In the Linux kernel, the following vulnerability has been resolved:
bpf, arm64: Fix off-by-one in check_imm signed range check
check_imm(bits, imm) is used in the arm64 BPF JIT to verify that
a branch displacement (in arm64 instruction units) fits into the
signed N-bit immediate field of a B, B.cond or CBZ/CBNZ encoding
before it is handed to the encoder. The macro currently tests for
(imm > 0 && imm >> bits) || (imm < 0 && ~imm >> bits) which admits
values in [-2^N, 2^N) — effectively a signed (N+1)-bit range. A
signed N-bit field only holds [-2^(N-1), 2^(N-1)), so the check
admits one extra bit of range on each side.
In particular, for check_imm19(), values in [2^18, 2^19) slip past
the check but do not fit into the 19-bit signed imm19 field of
B.cond. aarch64_insn_encode_immediate() then masks the raw value
into the 19-bit field, setting bit 18 (the sign bit) and flipping
a forward branch into a backward one. Same class of issue exists
for check_imm26() and the B/BL encoding. Shift by (bits - 1)
instead of bits so the actual signed N-bit range is enforced.
📍 영향받는 시스템
arm64 아키텍처를 사용하는 Linux 커널 (BPF JIT 활성화 상태)
⚔️ 공격 벡터
조작된 BPF 프로그램을 로드하여 JIT 컴파일 과정에서 잘못된 분기 명령어를 생성하도록 유도
🛡️ 대응 방법
Linux 커널을 최신 보안 패치가 적용된 버전으로 업데이트하여 check_imm 함수의 범위 검증 로직 수정
🔧 검증 코드
커널 버전과 BPF JIT 활성화 여부를 확인하고, 최신 패치 버전이 적용되었는지 릴리스 노트를 통해 대조하십시오.
uname -a && grep -i 'CONFIG_BPF_JIT' /boot/config-$(uname -r) 2>/dev/null