🇰🇷 한글 설명
리눅스 커널의 push-switch 드라이버에서 정리 작업 순서 오류로 인해 Use-After-Free 취약점이 발생합니다. 기존 코드에서는 타이머를 먼저 종료하지 않고 워커를 중단시켜, 메모리가 해제된 후에도 타이머가 다시 워커를 호출하여 메모리 오류를 일으킬 수 있습니다.
💡 쉬운 설명
컴퓨터가 사용 중인 부품을 정리할 때, 전원을 먼저 끄지 않고 부품을 치워버려서 발생하는 문제입니다. 이로 인해 시스템이 갑자기 멈추거나 해킹에 악용될 수 있는 메모리 오류가 발생합니다.
🇺🇸 원문 (English)
In the Linux kernel, the following vulnerability has been resolved:
sh: push-switch: Reorder cleanup operations to avoid use-after-free bug
The original code puts flush_work() before timer_shutdown_sync()
in switch_drv_remove(). Although we use flush_work() to stop
the worker, it could be rescheduled in switch_timer(). As a result,
a use-after-free bug can occur. The details are shown below:
(cpu 0) | (cpu 1)
switch_drv_remove() |
flush_work() |
... | switch_timer // timer
| schedule_work(&psw->work)
timer_shutdown_sync() |
... | switch_work_handler // worker
kfree(psw) // free |
| psw->state = 0 // use
This patch puts timer_shutdown_sync() before flush_work() to
mitigate the bugs. As a result, the worker and timer will be
stopped safely before the deallocate operations.
📍 영향받는 시스템
Linux kernel (push-switch 드라이버를 사용하는 시스템)
⚔️ 공격 벡터
특정 드라이버 제거 과정에서 타이머와 워커 간의 경쟁 상태(Race Condition)를 유도하여 메모리 오류 유발
🛡️ 대응 방법
커널 패치를 적용하여 switch_drv_remove() 함수 내에서 timer_shutdown_sync()를 flush_work()보다 먼저 호출하도록 수정
🔧 검증 코드
현재 실행 중인 커널 버전을 확인하여 해당 취약점이 수정된 최신 패치 버전인지 확인합니다.