🇰🇷 한글 설명
Linux 커널의 BPF 트램펄린 기능에서 8바이트를 초과하는 반환 값을 처리할 때 데이터 손실 및 메모리 오염이 발생하는 취약점입니다. fexit, fmod_ret, fsession 및 struct_ops와 같이 대상 함수의 반환 값을 읽는 유형에서 16바이트 반환 값을 허용하여 발생하며, 이를 통해 실제 호출자가 보는 값이 손상될 수 있습니다.
💡 쉬운 설명
프로그램이 결과값을 전달할 때 너무 큰 값을 사용하면, 시스템이 이를 다 담지 못해 데이터가 깨지거나 엉뚱한 값이 전달될 수 있는 문제입니다. 이로 인해 프로그램이 예상치 못한 동작을 하거나 시스템 오류가 발생할 수 있습니다.
🇺🇸 원문 (English)
In the Linux kernel, the following vulnerability has been resolved:
bpf: Reject >8 byte return values on return-reading trampoline paths
btf_distill_func_proto() builds the function model used for the
fentry/fexit/fmod_ret/fsession trampolines and struct_ops. It has
accepted a 16-byte __int128 return value since the trampoline was
introduced: __get_type_size() returns the integer's type size, and the
return-type check only rejected ret < 0.
But the BPF trampoline preserves only 8 bytes of the return value (RAX on
x86, i.e. R0). For an attach type that reads the target's return value the
second half (RDX / R3) is neither saved nor restored, so a program
attached to a function returning a 16-byte value corrupts the value seen
by the real caller and itself observes only half of it. struct_ops
trampolines have the same limitation.
This affects the attach types that read the target's return value: fexit,
fmod_ret and fsession (plus the _multi variants of fexit and fsession),
and struct_ops. fentry/fentry_multi run before the target returns and are
unaffected.
Reject a >8 byte return value for these attach types in
bpf_check_attach_target() and bpf_check_attach_btf_id_multi(), and for
struct_ops in bpf_struct_ops_desc_init().
📍 영향받는 시스템
Linux kernel (fexit, fmod_ret, fsession, struct_ops를 사용하는 BPF 환경)
⚔️ 공격 벡터
16바이트 반환 값을 가진 함수에 BPF 트램펄린을 부착하여 반환 값의 하위 8바이트를 조작하거나 상위 8바이트를 손상시킴
🛡️ 대응 방법
8바이트를 초과하는 반환 값을 사용하는 BPF 부착 시도를 거부하도록 커널을 업데이트하거나 패치 적용
🔧 검증 코드
현재 실행 중인 커널 버전을 확인하여 해당 취약점이 패치된 최신 보안 업데이트 버전인지 확인합니다.