🇰🇷 한글 설명
RSI 무선 드라이버에서 kthread의 자기 종료와 외부 정지 간 경쟁 조건으로 인해 Use-After-Free(UAF) 취약점이 발생합니다. kthread_complete_and_exit()가 먼저 호출된 후 kthread_stop()이 실행되면 이미 해제된 메모리에 접근하여 시스템 불안정을 초래할 수 있습니다.
💡 쉬운 설명
드라이버가 종료되는 과정에서 메모리 정리와 강제 정지 명령이 충돌하여, 이미 사라진 메모리를 다시 접근하는 오류가 발생합니다. 이는 시스템이 충돌하거나 악의적인 코드 실행으로 이어질 수 있는 보안 결함입니다.
🇺🇸 원문 (English)
In the Linux kernel, the following vulnerability has been resolved:
wifi: rsi: fix kthread lifetime race between self-exit and external-stop
RSI driver use both self-exit(kthread_complete_and_exit) and external-stop
(kthread_stop) when killing a kthread. Generally, kthread_stop() is called
first, and in this case, no particular issues occur.
However, in rare instances where kthread_complete_and_exit() is called
first and then kthread_stop() is called, a UAF occurs because the kthread
object, which has already exited and been freed, is accessed again.
Therefore, to prevent this with minimal modification, you must remove
kthread_stop() and change the code to wait until the self-exit operation
is completed.
📍 영향받는 시스템
Linux kernel (RSI WiFi driver 포함)
⚔️ 공격 벡터
특정 타이밍으로 스레드 종료 및 정지 명령을 유발하여 메모리 손상 발생
🛡️ 대응 방법
커널 패치 적용 및 kthread_stop() 제거 후 자기 종료 완료 대기 로직 적용
🔧 검증 코드
출력된 커널 버전이 패치가 적용된 최신 버전인지 확인