🇰🇷 한글 설명
Linux 커널의 BPF 검증기(verifier)에서 투기적 실행(speculative execution) 경로에 대해 bpf_scc_visit 할당 여부를 잘못 판단하여 verifier_bug()를 호출하는 취약점이 해결되었습니다. 기존에는 SCC 내의 상태에 대해 bpf_scc_visit 인스턴스가 반드시 존재해야 한다고 가정했으나, 투기적 경로에서는 이 가정이 성립하지 않아 오류가 발생했습니다.
💡 쉬운 설명
컴퓨터가 미래를 예측하며 실행하는 과정에서 발생할 수 있는 사소한 논리적 오류를 수정했습니다. 이 오류로 인해 시스템이 비정상적으로 멈추거나 오류 보고를 할 수 있었던 문제를 해결한 것입니다.
🇺🇸 원문 (English)
In the Linux kernel, the following vulnerability has been resolved:
bpf: dont report verifier bug for missing bpf_scc_visit on speculative path
Syzbot generated a program that triggers a verifier_bug() call in
maybe_exit_scc(). maybe_exit_scc() assumes that, when called for a
state with insn_idx in some SCC, there should be an instance of struct
bpf_scc_visit allocated for that SCC. Turns out the assumption does
not hold for speculative execution paths. See example in the next
patch.
maybe_scc_exit() is called from update_branch_counts() for states that
reach branch count of zero, meaning that path exploration for a
particular path is finished. Path exploration can finish in one of
three ways:
a. Verification error is found. In this case, update_branch_counts()
is called only for non-speculative paths.
b. Top level BPF_EXIT is reached. Such instructions are never a part of
an SCC, so compute_scc_callchain() in maybe_scc_exit() will return
false, and maybe_scc_exit() will return early.
c. A checkpoint is reached and matched. Checkpoints are created by
is_state_visited(), which calls maybe_enter_scc(), which allocates
bpf_scc_visit instances for checkpoints within SCCs.
Hence, for non-speculative symbolic execution paths, the assumption
still holds: if maybe_scc_exit() is called for a state within an SCC,
bpf_scc_visit instance must exist.
This patch removes the verifier_bug() call for speculative paths.
📍 영향받는 시스템
Linux Kernel (BPF verifier 관련 버전)
⚔️ 공격 벡터
특수하게 조작된 BPF 프로그램을 로드하여 커널 검증기에서 오류를 유발하는 방식
🛡️ 대응 방법
최신 보안 패치가 적용된 Linux 커널로 업데이트
🔧 검증 코드
출력된 커널 버전이 해당 취약점이 수정된 패치 버전 이후인지 확인