🇰🇷 한글 설명
Linux 커널의 BPF(Berkeley Packet Filter) 구성 요소에서 로드-획득(load-acquire) 작업 시 소스 포인터의 타입을 검사하기 전에 메모리 로드를 먼저 수행하는 취약점이 발견되었습니다. 이로 인해 허용되지 않는 타입(ctx, pkt 등)에 대한 검증이 우회되어 커널 객체에 대한 타입 혼동(Type Confusion)이 발생할 수 있습니다.
💡 쉬운 설명
컴퓨터의 핵심 운영체제인 리눅스에서 특정 데이터를 읽을 때 보안 검사를 건너뛰는 허점이 발견되었습니다. 공격자가 이를 악용하면 시스템의 중요한 정보를 잘못된 방식으로 읽거나 조작하여 보안을 무너뜨릴 수 있습니다.
🇺🇸 원문 (English)
In the Linux kernel, the following vulnerability has been resolved:
bpf: Check load-acquire src ptr type before the load
check_atomic_load() calls check_load_mem() before atomic_ptr_type_ok().
For a load-acquire that fetches into its own source register (dst_reg ==
src_reg), check_load_mem() overwrites src_reg's type with the type of the
loaded value, so the subsequent atomic_ptr_type_ok() no longer sees the
source pointer and fails to reject the disallowed types (ctx, pkt,
flow_keys, sock).
Since bpf_convert_ctx_accesses() does not rewrite atomic loads, the raw
access to the underlying kernel object is left in place. The destination
type is taken from the ctx access itself, so a load-acquire of the sk
field of struct __sk_buff for example leaves the register typed as
PTR_TO_SOCK_COMMON_OR_NULL, which type_is_sk_pointer() does not match
either, while it actually holds unconverted struct sk_buff bytes. Once
the NULL check has passed this is a type confusion, not just a leak of
kernel data.
Validate src_reg with check_reg_arg() and check the source pointer type
with atomic_ptr_type_ok() before the load again, mirroring
check_atomic_rmw(). Out-of-range register numbers are already rejected
earlier by check_and_resolve_insns() (commit 503d21ef8eac ("bpf: Do
register range validation early")), and the only exemption there,
is_stack_arg_ldx(), requires BPF_LDX | BPF_MEM | BPF_DW and thus never
matches a BPF_ATOMIC insn. atomic_ptr_type_ok() can therefore not
dereference register state out of bounds, that is, the out-of-bounds
read addressed by the Fixes commit below does not reappear (as proven
also via selftest).
📍 영향받는 시스템
Linux Kernel (BPF 기능이 활성화된 버전)
⚔️ 공격 벡터
BPF 프로그램을 통해 허용되지 않는 커널 객체 타입에 접근하여 타입 혼동을 유발하는 방식
🛡️ 대응 방법
커널 패치를 적용하여 로드 전 소스 포인터 타입 검증 로직을 강화해야 함
🔧 검증 코드
현재 실행 중인 커널 버전을 확인하여 해당 취약점이 해결된 최신 패치 버전인지 확인합니다.