🇰🇷 한글 설명
Linux 커널의 hwmon(pwm-fan) 드라이버에서 타이머 종료와 메모리 해제 순서가 잘못되어 발생하는 취약점입니다. 드라이버 분리 시 타이머가 먼저 중지되지 않아, 이미 해제된 메모리 영역에 접근하여 데이터 오류나 시스템 불안정을 유발할 수 있습니다.
💡 쉬운 설명
팬 속도를 측정하는 타이머가 작동 중인데 측정에 필요한 메모리가 먼저 삭제되어 발생하는 문제입니다. 이로 인해 컴퓨터 시스템이 갑자기 멈추거나 오류가 발생할 수 있습니다.
🇺🇸 원문 (English)
In the Linux kernel, the following vulnerability has been resolved:
hwmon: (pwm-fan) Stop RPM timer before freeing tach data
sample_timer() rearms the RPM timer and accesses the devm-managed
ctx->tachs and ctx->pulses_per_revolution arrays. The cleanup action
which stops the timer is registered before those arrays are allocated.
Since devres releases entries in reverse order, driver detach can free
the arrays before pwm_fan_cleanup() shuts down the timer. A timer expiry
in that window accesses the freed tach data.
With a KASAN kernel, a test-only kprobe delayed entry to
pwm_fan_cleanup() while normal sysfs unbind ran. Each of three runs
reported three four-byte reads and two four-byte writes in sample_timer()
after its backing devm allocations had been freed. The helper did not
invoke the timer callback, cleanup actions or free functions.
With the fix, three matching unbind runs completed without KASAN, BUG,
WARNING, Oops or panic. Instrumentation confirmed that timer retirement
completed before the first timer backing allocation was released.
Split timer retirement from the power cleanup and register its devres
action after the timer backing data and IRQ actions are installed. This
preserves the early power rollback action while ensuring the timer is
retired before its backing data is released. Use timer_shutdown_sync()
because the callback can rearm itself.
📍 영향받는 시스템
Linux kernel (hwmon/pwm-fan driver component)
⚔️ 공격 벡터
로컬 시스템에서 드라이버를 분리(unbind)하는 과정에서 발생하는 레이스 컨디션(Race Condition)
🛡️ 대응 방법
Linux 커널을 최신 보안 패치가 적용된 버전으로 업데이트하십시오.
🔧 검증 코드
출력된 커널 버전이 해당 취약점이 수정된 패치 버전 이후인지 확인하십시오.