🇰🇷 한글 설명
Linux 커널의 rt9455 전원 공급 장치 드라이버에서 작업 종료 순서가 잘못되어 발생하는 Use-After-Free 취약점입니다. 장치 제거 과정에서 특정 지연 작업이 취소된 후 다시 큐에 등록될 수 있으며, 이로 인해 이미 해제된 메모리 영역에 접근하여 시스템 충돌이나 보안 문제를 일으킬 수 있습니다.
💡 쉬운 설명
기기가 꺼질 때 정리 작업이 순서대로 이루어지지 않아, 이미 사라진 데이터에 접근하려고 시도하는 오류입니다. 이로 인해 컴퓨터 시스템이 갑자기 멈추거나 예상치 못한 동작을 할 수 있습니다.
🇺🇸 원문 (English)
In the Linux kernel, the following vulnerability has been resolved:
power: supply: rt9455: quiesce delayed work before teardown
The threaded IRQ handler can queue pwr_rdy_work,
max_charging_time_work and batt_presence_work. pwr_rdy_work and
batt_presence_work can also queue max_charging_time_work, while
batt_presence_work can requeue itself.
rt9455_remove() cancels max_charging_time_work before
batt_presence_work. The latter can therefore queue
max_charging_time_work after it has already been cancelled:
rt9455_remove() workqueue
cancel pwr_rdy_work
cancel max_charging_time_work
batt_presence_work queues
max_charging_time_work
cancel batt_presence_work
return
devres frees rt9455_info
max_charging_time_work dereferences
rt9455_info
The IRQ also remains registered until devres cleanup and can queue more
work after any of the cancellation calls. If rt9455_hw_init() fails
after the IRQ has been requested, probe returns without cancelling work
that may already have been queued. A pending callback can then access
rt9455_info after it has been freed.
Register rt9455_cancel_all_delayed_works() through
devm_add_action_or_reset() right after devm_power_supply_register().
devres invokes the action in reverse registration order, after the
managed IRQ has been freed and before rt9455_info is released, so the
delayed works are drained in both rt9455_remove() and the probe error
path. Cancel pwr_rdy_work and batt_presence_work before
max_charging_time_work because both can queue the latter.
This issue was found by an in-house static analysis tool.
📍 영향받는 시스템
rt9455 드라이버를 사용하는 Linux 커널 기반 시스템
⚔️ 공격 벡터
로컬 공격자가 특정 하드웨어 이벤트나 전원 상태 변화를 유도하여 메모리 오류를 발생시킴
🛡️ 대응 방법
rt9455 관련 지연 작업의 취소 순서를 수정하고 devm_add_action_or_reset()을 사용하여 안전한 정리 프로세스를 적용한 최신 커널로 업데이트
🔧 검증 코드
출력된 커널 버전이 해당 취약점이 패치된 최신 보안 업데이트 버전인지 확인