🇰🇷 한글 설명
Linux 커널의 timerlat 트레이서에서 SIGTERM 신호로 인해 스레드가 종료될 때, 새로운 트레이싱 인스턴스가 시작되면서 기존 스레드를 초기화하는 과정에서 Use-After-Free 취약점이 발생합니다. 이로 인해 hrtimer가 중복으로 해제되어 시스템 불안정이나 보안 위협을 초래할 수 있습니다.
💡 쉬운 설명
프로그램이 종료되는 도중에 새로운 프로그램이 실행되면서, 이미 사라진 메모리 자원을 다시 건드리려고 할 때 발생하는 오류입니다. 이로 인해 컴퓨터 시스템이 갑자기 멈추거나 해킹의 통로가 될 수 있습니다.
🇺🇸 원문 (English)
In the Linux kernel, the following vulnerability has been resolved:
tracing/timerlat: Only clear timer if a kthread exists
The timerlat tracer can use user space threads to check for osnoise and
timer latency. If the program using this is killed via a SIGTERM, the
threads are shutdown one at a time and another tracing instance can start
up resetting the threads before they are fully closed. That causes the
hrtimer assigned to the kthread to be shutdown and freed twice when the
dying thread finally closes the file descriptors, causing a use-after-free
bug.
Only cancel the hrtimer if the associated thread is still around. Also add
the interface_lock around the resetting of the tlat_var->kthread.
Note, this is just a quick fix that can be backported to stable. A real
fix is to have a better synchronization between the shutdown of old
threads and the starting of new ones.
📍 영향받는 시스템
Linux Kernel (timerlat tracer를 사용하는 환경)
⚔️ 공격 벡터
특정 트레이싱 도구를 사용하는 프로세스에 SIGTERM 신호를 보내 스레드 종료와 재시작을 유도하는 방식
🛡️ 대응 방법
커널 패치를 적용하여 hrtimer 취소 시 스레드 존재 여부를 확인하고 interface_lock을 사용하도록 업데이트해야 합니다.
🔧 검증 코드
현재 실행 중인 커널 버전을 확인하여 해당 취약점이 해결된 패치 버전인지 확인합니다.