🇰🇷 한글 설명
Linux 커널의 max3100 시리얼 드라이버에서 시스템 절전 모드 전환 시 타이머가 적절히 종료되지 않아 발생하는 취약점입니다. 이로 인해 장치가 해제된 후에도 타이머가 동작하여 이미 해제된 메모리 영역에 접근하는 Use-After-Free 문제가 발생할 수 있습니다.
💡 쉬운 설명
컴퓨터가 잠자기 모드로 들어갈 때 특정 부품의 타이머를 꺼야 하는데, 이를 깜빡하고 부품을 제거하는 오류입니다. 이 때문에 컴퓨터가 깨어날 때 이미 사라진 부품을 다시 찾으려다 시스템이 충돌하거나 오류가 발생할 수 있습니다.
🇺🇸 원문 (English)
In the Linux kernel, the following vulnerability has been resolved:
tty: serial: max3100: shut down timer before freeing port
max3100_shutdown() stops the polling timer but returns early during
system suspend. If the SPI device is unbound before resume, the serial
core does not call max3100_shutdown() again, so max3100_remove() frees
the port while the timer remains armed. max3100_timeout() may then
access the freed port and re-arm the timer.
Add final timer teardown to max3100_remove() and use
timer_shutdown_sync() to prevent a racing callback from re-arming it.
Also free the IRQ and destroy the workqueue there before freeing the
port. Keep timer_delete_sync() in max3100_shutdown() so that a
subsequent open() can re-arm the timer.
The workqueue is created before request_irq() and destroyed on both
request_irq() failure and normal shutdown. Its presence at remove thus
identifies the IRQ left registered when suspend bypasses shutdown.
Free the IRQ before destroying the workqueue, in both
max3100_shutdown() and max3100_remove(), and cancel the pending work
in between. free_irq() waits for a running interrupt handler to
finish and no new handler can start afterwards, so a racing handler
cannot queue work on a workqueue that is being destroyed; the
force_end_work check in max3100_dowork() only narrows that window, as
a handler delayed between the check and queue_work() could still run
after the teardown has cleared the workqueue pointer. Cancelling the
work also keeps destroy_workqueue() from waiting on a queued work item
in case remove() ever runs while the freezable workqueue is still
frozen, e.g. device removal during the resume window, before
workqueues are thawed.
This issue was found by an in-house static analysis tool.
📍 영향받는 시스템
Linux kernel (max3100 serial driver 사용 시스템)
⚔️ 공격 벡터
로컬 공격자가 시스템의 절전 모드(Suspend)와 장치 해제(Unbind) 과정을 정밀하게 조작하여 메모리 오류 유도
🛡️ 대응 방법
Linux 커널을 최신 보안 패치가 적용된 버전으로 업데이트하여 max3100_remove()의 타이머 및 IRQ 해제 로직 적용
🔧 검증 코드
출력된 커널 버전이 해당 취약점이 수정된 패치 버전 이후인지 확인