🇰🇷 한글 설명
리눅스 커널의 mmc hsq 모듈에서 retry_work 작업이 드라이버 제거 시 적절히 취소되지 않아 발생하는 Use-After-Free 취약점입니다. 드라이버가 해제된 후에도 대기 중인 작업이 실행되면서 이미 해제된 메모리 영역인 hsq->mmc 및 hsq->mrq를 참조하게 됩니다.
💡 쉬운 설명
컴퓨터 부품을 제거할 때 하던 일을 멈추지 않고 계속하려고 해서 발생하는 오류입니다. 이미 사라진 메모리 주소를 다시 사용하려고 시도하기 때문에 시스템이 불안정해질 수 있습니다.
🇺🇸 원문 (English)
In the Linux kernel, the following vulnerability has been resolved:
mmc: hsq: Fix use-after-free in retry work
mmc_hsq_pump_requests() queues retry_work when request_atomic() returns
-EBUSY; today sdhci-sprd is the only consumer that implements
request_atomic(). The work is embedded in a devm-allocated mmc_hsq, but
is never cancelled during driver removal. Work still pending at unbind
can therefore run after the devm allocation has been released and
dereference hsq->mmc and hsq->mrq.
Use devm_work_autocancel() to cancel and drain retry_work before the devm
allocation is released. By the time devres cleanup begins,
mmc_remove_host() has already stopped the host, so no new requests can
arm the work.
This issue was found by an in-house static analysis tool.
📍 영향받는 시스템
Linux kernel (mmc/hsq 관련 모듈을 사용하는 시스템)
⚔️ 공격 벡터
로컬 공격자가 드라이버 언바인드(unbind)를 유도하여 메모리 오류를 발생시킴
🛡️ 대응 방법
커널 패치를 적용하여 devm_work_autocancel()을 통해 드라이버 제거 시 작업을 취소하도록 업데이트
🔧 검증 코드
출력된 커널 버전이 해당 취약점이 수정된 패치 버전 이후인지 확인