🇰🇷 한글 설명
Linux 커널의 hwmon(gpio-fan) 드라이버에서 alarm work 처리 중 Use-After-Free 취약점이 발견되었습니다. 장치 해제 시 인터럽트 해제와 작업 취소 순서가 적절하지 않아, 이미 해제된 메모리 영역에 접근할 수 있는 문제가 있습니다.
💡 쉬운 설명
하드웨어 팬(fan)을 제어하는 소프트웨어가 종료될 때, 이미 사라진 메모리 정보를 다시 사용하려고 시도하여 오류가 발생하는 문제입니다. 이로 인해 시스템이 불안정해지거나 예기치 않은 동작이 발생할 수 있습니다.
🇺🇸 원문 (English)
In the Linux kernel, the following vulnerability has been resolved:
hwmon: (gpio-fan) Fix use-after-free in alarm work
fan_alarm_irq_handler() queues fan_data->alarm_work, but nothing
cancels it. fan_alarm_notify() dereferences fan_data and its hwmon
device. On unbind, devres frees the interrupt, which only waits for
the handler itself, and then releases the hwmon device and fan_data,
so a pending fan_alarm_notify() can run after those frees.
Replace INIT_WORK() with devm_work_autocancel(), registered before
devm_request_irq(). The devres cleanup then frees the interrupt
first, so no new work can be queued, and cancels the work while
fan_data and the hwmon device are still alive.
This issue was found by an in-house static analysis tool.
📍 영향받는 시스템
Linux kernel (gpio-fan driver 사용 시스템)
⚔️ 공격 벡터
로컬 공격자가 장치 드라이버의 unbind 과정을 유도하여 메모리 오류를 일으킬 수 있음
🛡️ 대응 방법
Linux 커널을 최신 보안 패치가 적용된 버전으로 업데이트하거나 devm_work_autocancel()이 적용된 패치를 적용하십시오.
🔧 검증 코드
출력된 커널 버전이 해당 취약점이 수정된 패치 버전 이후인지 확인하십시오.