🇰🇷 한글 설명
Linux 커널의 BPF 검증기(verifier)에서 범위 전파(range propagation) 과정 중 subreg_def 마크를 제대로 보존하지 못하는 취약점입니다. 이로 인해 BPF_F_TEST_RND_HI32 플래그가 설정된 경우 검증기가 레지스터 값을 잘못 재작성하여 보안 검증을 우회할 수 있습니다.
💡 쉬운 설명
리눅스 커널의 특정 기능을 검사하는 프로그램이 계산 과정을 잘못 이해하여, 원래는 허용되지 않는 데이터에 접근할 수 있게 만드는 오류입니다. 이 오류를 이용하면 프로그램이 의도치 않은 값을 읽어 들여 시스템 보안을 위협할 수 있습니다.
🇺🇸 원문 (English)
In the Linux kernel, the following vulnerability has been resolved:
bpf: sync_linked_regs() must preserve subreg_def
Range propagation must not affect subreg_def marks, otherwise the
following example is rewritten by verifier incorrectly when
BPF_F_TEST_RND_HI32 flag is set:
0: call bpf_ktime_get_ns call bpf_ktime_get_ns
1: r0 &= 0x7fffffff after verifier r0 &= 0x7fffffff
2: w1 = w0 rewrites w1 = w0
3: if w0 < 10 goto +0 --------------> r11 = 0x2f5674a6 (r)
4: r1 >>= 32 r11 <<= 32 (r)
5: r0 = r1 r1 |= r11 (r)
6: exit; if w0 < 0xa goto pc+0
r1 >>= 32
r0 = r1
exit
(or zero extension of w1 at (2) is missing for architectures that
require zero extension for upper register half).
The following happens w/o this patch:
- r0 is marked as not a subreg at (0);
- w1 is marked as subreg at (2);
- w1 subreg_def is overridden at (3) by copy_register_state();
- w1 is read at (5) but mark_insn_zext() does not mark (2)
for zero extension, because w1 subreg_def is not set;
- because of BPF_F_TEST_RND_HI32 flag verifier inserts random
value for hi32 bits of (2) (marked (r));
- this random value is read at (5).
📍 영향받는 시스템
BPF 기능을 사용하는 Linux Kernel (패치 적용 전 버전)
⚔️ 공격 벡터
특수하게 조작된 BPF 프로그램을 로드하여 커널 검증기의 논리적 오류를 유도
🛡️ 대응 방법
Linux 커널을 최신 보안 패치가 적용된 버전으로 업데이트
🔧 검증 코드
출력된 커널 버전이 해당 취약점이 해결된 패치 버전 이후인지 확인