🇰🇷 한글 설명
Linux 커널의 tracing 기능에서 event_trigger_data를 해제하는 과정 중 Use-After-Free 취약점이 발견되었습니다. 데이터 해제 시점과 동기화 메커니즘의 불일치로 인해, 데이터가 해제된 후에도 동시 실행 중인 tracepoint 핸들러가 해당 메모리에 접근할 수 있는 문제가 있습니다.
💡 쉬운 설명
컴퓨터의 기록을 남기는 기능에서 이미 삭제된 메모리 정보를 다른 프로그램이 사용하려고 시도할 때 발생하는 오류입니다. 이로 인해 시스템이 충돌하거나 보안 문제가 생길 수 있습니다.
🇺🇸 원문 (English)
In the Linux kernel, the following vulnerability has been resolved:
tracing: Fix use-after-free freeing trigger private data
Commit 61d445af0a7c ("tracing: Add bulk garbage collection of freeing
event_trigger_data") moved the kfree() of event_trigger_data to a kthread
that runs tracepoint_synchronize_unregister() before freeing. That removed
the synchronization the trigger .free callbacks used to get implicitly and
inline from trigger_data_free().
event_hist_trigger_free(), event_hist_trigger_named_free() and
event_enable_trigger_free() free their satellite data (hist_data, cmd_ops,
enable_data) right after trigger_data_free() returns. With the
synchronization now deferred to the kthread, a concurrent tracepoint
handler can still reach that data through the list_del_rcu()'d trigger,
causing a use-after-free.
The histogram teardown must stay synchronous: remove_hist_vars() and
unregister_field_var_hists() have to detach a synthetic event from the
histogram before the trigger-removal write returns, otherwise a following
command races in and the synthetic-event removal fails with -EBUSY, as the
trigger-synthetic-eprobe.tc selftest catches. Make those callbacks wait
with the correct barrier - tracepoint_synchronize_unregister(), matching
the free kthread - before freeing.
The enable trigger has no such synchronous requirement, and a blocking
synchronize there would re-serialize the path that commit deliberately
deferred. Give it an optional private_data_free() callback that the free
kthread runs after its grace period, and free enable_data from there.
📍 영향받는 시스템
Linux Kernel (tracing 기능이 활성화된 버전)
⚔️ 공격 벡터
동시성 제어 미흡을 이용한 Race Condition 공격을 통해 메모리 접근 시도
🛡️ 대응 방법
커널 패치(Commit 61d445af0a7c 관련 수정 사항)를 적용하여 메모리 해제 전 동기화 프로세스 강화
🔧 검증 코드
출력된 커널 버전을 확인하여 해당 취약점이 해결된 최신 패치 버전인지 확인합니다.