🇰🇷 한글 설명
Linux 커널의 memstick 드라이버(rtsx_usb_ms) 결함으로, 카드 제거 경합 상황에서 요청이 완료되지 않고 버려져 memstick_check()와 memstick_remove_host()가 무한 대기(행)에 빠질 수 있습니다. 패치는 요청을 버리지 않고 항상 완료(-ENOMEDIUM 실패 처리)하며, 드라이버 제거 시 cancel 대신 flush를 사용하도록 수정합니다.
💡 쉬운 설명
USB 카드 리더에서 메모리 카드를 뽑는 순간 시스템 내부 작업이 멈춰 버리는 문제입니다. 이로 인해 커널 작업이 응답하지 않고 멈춘 상태가 될 수 있습니다.
🇺🇸 원문 (English)
In the Linux kernel, the following vulnerability has been resolved:
memstick: rtsx_usb_ms: complete requests after eject instead of dropping them
memstick_check() can pass its host->removing check just before
rtsx_usb_ms_drv_remove() sets eject/removing. Its next request is then
silently dropped: rtsx_usb_ms_request() skips schedule_work() once eject
is set, and drv_remove's cancel_work_sync() can also cancel a queued
handle_req before it picks the request up. Nobody completes
card->mrq_complete.
Once memstick core waits for requests without a timeout ("memstick: core:
wait for request completion before freeing card"), this hangs removal:
memstick_check() never returns and memstick_remove_host() blocks in
flush_workqueue():
INFO: task kworker/u10:3:65 blocked for more than 20 seconds.
Workqueue: kmemstick memstick_check
__wait_for_common
memstick_check
INFO: task kworker/1:1:33 blocked for more than 20 seconds.
Workqueue: usb_hub_wq hub_event
__flush_workqueue
memstick_remove_host
rtsx_usb_ms_drv_remove
Never drop a request. rtsx_usb_ms_request() always schedules handle_req,
and handle_req fails requests with -ENOMEDIUM once eject is set, without
touching the device. drv_remove flushes handle_req instead of cancelling
it, and cancels it only after memstick_remove_host(), when no new
request can arrive, so it cannot run on a freed host.
The host_mutex drain in drv_remove is removed: handle_req always leaves
host->req NULL when it finishes, so the drain never had anything to do,
and it would now race with handle_req.
📍 영향받는 시스템
패치가 포함되지 않은 Linux 커널 (rtsx_usb_ms 드라이버 사용 Realtek USB 카드 리더 환경, 정확한 버전 범위는 해당 커널 배포판 확인 필요)
⚔️ 공격 벡터
물리적 장치 제거 등 정상적인 하드웨어 동작 중 발생하는 경합 조건으로, 원격 공격 벡터는 명확히 확인되지 않음 (서비스 거부 성격)
🛡️ 대응 방법
Linux 커널을 해당 수정 사항(memstick: rtsx_usb_ms: complete requests after eject)이 포함된 최신 안정 버전 또는 배포판 보안/업데이트로 업그레이드
🔧 검증 코드
출력된 커널 버전을 배포판 공지나 Linux 커널 Git 저장소의 해당 커밋 포함 여부와 비교하여, 수정이 적용된 버전인지 확인합니다.