🇰🇷 한글 설명
Linux 커널의 tracing 기능에서 dynamic event 처리 시 'module' 포인터와 'refcnt' 변수가 동일한 메모리 공간을 공유하는 union 구조로 인해 충돌이 발생합니다. 이로 인해 특정 모듈을 필터링할 때 참조 카운트 값을 잘못된 포인터로 인식하여 커널 패닉(Oops)이 발생할 수 있습니다.
💡 쉬운 설명
커널이 특정 기능을 실행할 때 사용하는 숫자 값을 메모리 주소로 착각하여 시스템이 멈추거나 오류가 발생하는 문제입니다. 동적 이벤트를 설정하는 과정에서 데이터가 겹쳐서 발생하는 오류입니다.
🇺🇸 원문 (English)
In the Linux kernel, the following vulnerability has been resolved:
tracing: Fix union collision of module and refcnt for dynamic events
In 'struct trace_event_call', the 'module' pointer and the 'refcnt'
atomic variable share the same memory space in a union. For dynamic
events, the union member is 'refcnt', which acts as an active
reference counter.
When a dynamic event (such as kprobe, uprobe, fprobe, eprobe, or
wprobe) has a non-zero reference count (e.g. due to active event
triggers or perf attachments), its 'call->module' evaluates to a
small non-zero integer instead of NULL.
When filtering or setting events for a specific module (e.g., writing
':mod:<module>' to 'set_event'), the code in
'__ftrace_set_clr_event_nolock()' and 'update_event_fields()' reads
'call->module' directly without checking whether the event is dynamic.
This causes the kernel to treat the small integer (refcnt) as a
'struct module' pointer, leading to a NULL/invalid pointer dereference
(Oops) when dereferencing the module name.
Fix this by ensuring that the 'TRACE_EVENT_FL_DYNAMIC' flag is checked
before treating 'call->module' as a valid pointer in these code paths.
📍 영향받는 시스템
Linux kernel (dynamic event tracing 기능을 사용하는 버전)
⚔️ 공격 벡터
특정 모듈을 대상으로 하는 dynamic event(kprobe, uprobe 등)를 설정하거나 필터링하는 동작을 통해 유도 가능
🛡️ 대응 방법
커널 패치를 통해 dynamic event 플래그를 확인하도록 수정된 최신 커널 버전으로 업데이트
🔧 검증 코드
출력된 커널 버전이 해당 취약점이 해결된 패치 버전인지 배포판 보안 공지를 통해 확인
💻 영향받는 소프트웨어
NVIDIA vGPU Guest Driver for Linux