🇰🇷 한글 설명
Linux 커널의 BPF 검증기(verifier)에서 BPF_ADD_CONST 스칼라 값의 base id 일관성을 제대로 확인하지 않는 취약점입니다. 이로 인해 서로 다른 레지스터 상태가 잘못된 매핑을 생성하여 검증기 우회 및 상태 가지치기(state pruning) 오류를 유발할 수 있습니다.
💡 쉬운 설명
리눅스 운영체제의 핵심 기능 중 하나인 BPF 검증 과정에서 계산 규칙을 확인하는 로직에 허점이 발견되었습니다. 공격자가 이 허점을 이용하면 시스템이 허용하지 않는 잘못된 명령을 실행하도록 속일 수 있습니다.
🇺🇸 원문 (English)
In the Linux kernel, the following vulnerability has been resolved:
bpf: Enforce regsafe base id consistency for BPF_ADD_CONST scalars
When regsafe() compares two scalar registers that both carry
BPF_ADD_CONST, check_scalar_ids() maps their full compound id
(aka base | BPF_ADD_CONST flag) as one idmap entry. However,
it never verifies that the underlying base ids, that is, with
the flag stripped are consistent with existing idmap mappings.
This allows construction of two verifier states where the old
state has R3 = R2 + 10 (both sharing base id A) while the current
state has R3 = R4 + 10 (base id C, unrelated to R2). The idmap
creates two independent entries: A->B (for R2) and A|flag->C|flag
(for R3), without catching that A->C conflicts with A->B. State
pruning then incorrectly succeeds.
Fix this by additionally verifying base ID mapping consistency
whenever BPF_ADD_CONST is set: after mapping the compound ids,
also invoke check_ids() on the base IDs (flag bits stripped).
This ensures that if A was already mapped to B from comparing
the source register, any ADD_CONST derivative must also derive
from B, not an unrelated C.
📍 영향받는 시스템
BPF 기능을 사용하는 Linux Kernel (패치 적용 전 버전)
⚔️ 공격 벡터
조작된 BPF 프로그램을 통해 검증기의 레지스터 ID 매핑 일관성을 무너뜨려 검증 로직을 우회함
🛡️ 대응 방법
Linux 커널을 최신 보안 패치가 적용된 버전으로 업데이트하여 BPF 검증기의 base ID 일관성 확인 로직을 적용해야 함
🔧 검증 코드
출력된 커널 버전을 확인하여 해당 취약점이 해결된 최신 보안 패치 버전인지 확인합니다.