🇰🇷 한글 설명
Linux 커널의 x25 네트워크 프로토콜 구현에서 타이머 관리 미흡으로 인한 Use-After-Free 취약점이 발견되었습니다. 타이머가 소켓 참조를 유지하지 못해 소켓이 해제된 후에도 타이머가 실행되어 메모리 오류를 유발할 수 있습니다.
💡 쉬운 설명
컴퓨터가 사용이 끝난 메모리 공간을 이미 지웠는데, 타이머라는 알람이 뒤늦게 작동하여 지워진 공간을 건드리는 문제입니다. 이로 인해 시스템이 멈추거나 보안 문제가 발생할 수 있습니다.
🇺🇸 원문 (English)
In the Linux kernel, the following vulnerability has been resolved:
net/x25: fix use-after-free of the socket by its timers
The x25 timers are armed with mod_timer() and cancelled with
timer_delete(), so a pending timer holds no reference on the socket and a
cancel does not wait for a callback already running on another CPU.
x25_heartbeat_expiry() also rearms unconditionally, so it can reinstall
sk->sk_timer after __x25_destroy_socket() has passed its cancel point.
The following __sock_put() frees the socket while the timer is still
queued, and the next expiry uses freed memory. KASAN reports a
slab-use-after-free on the kmalloc-2k object freed by close().
timer_delete_sync() cannot be used here: x25_heartbeat_expiry() and
x25_timer_expiry() both reach the cancels from inside the timer they
would wait on, through __x25_destroy_socket() and x25_disconnect().
Arm the timers with sk_reset_timer() and cancel them with sk_stop_timer()
so that an armed timer owns a reference, and release it in both expiry
handlers. Rearm the heartbeat only while sk_hashed(sk) is still true,
since __x25_destroy_socket() unlinks the socket before dropping it. Arm
the deferred destroy timer the same way and drop its reference in
x25_destroy_timer().
Reproduced on net with KASAN, with the heartbeat period shortened so the
window recurs. With this patch the reproducer no longer triggers a
report and /proc/net/x25 drains.
Discovered by XBOW, triaged by Baul Lee <
[email protected]>
📍 영향받는 시스템
Linux Kernel (x25 프로토콜을 사용하는 시스템)
⚔️ 공격 벡터
특수하게 조작된 X.25 네트워크 패킷을 전송하여 타이머와 소켓 해제 시점 간의 경쟁 상태(Race Condition) 유도
🛡️ 대응 방법
Linux 커널을 최신 보안 패치가 적용된 버전으로 업데이트하여 sk_reset_timer() 및 sk_stop_timer() 로직을 적용해야 합니다.
🔧 검증 코드
출력된 커널 버전이 해당 취약점이 패치된 최신 버전인지 보안 공지(Changelog)와 대조하여 확인합니다.