🇰🇷 한글 설명
Linux 커널의 hid-lenovo-go 드라이버에서 장치 제거 시 예약된 작업이 적절히 취소되지 않아 발생하는 취약점입니다. 장치가 해제된 후에도 지연된 작업이 실행되면서 이미 해제된 메모리 주소(stale pointer)를 참조하여 시스템 불안정이나 커널 패닉을 유발할 수 있습니다.
💡 쉬운 설명
장치를 연결했다가 아주 빠르게 제거할 때, 컴퓨터가 아직 이전 작업을 처리 중이라서 이미 사라진 장치를 다시 찾으려다 오류가 발생하는 문제입니다. 이로 인해 시스템이 갑자기 멈추거나 꺼질 수 있습니다.
🇺🇸 원문 (English)
In the Linux kernel, the following vulnerability has been resolved:
HID: hid-lenovo-go: cancel cfg_setup work in hid_go_cfg_remove()
hid_go_cfg_probe() initialises drvdata.go_cfg_setup and schedules it
to run 2 ms later:
INIT_DELAYED_WORK(&drvdata.go_cfg_setup, &cfg_setup);
schedule_delayed_work(&drvdata.go_cfg_setup, msecs_to_jiffies(2));
cfg_setup() dereferences drvdata.hdev to issue MCU command requests.
hid_go_cfg_remove() tears down sysfs and stops the HID device, but
never drains the delayed work. If the device is unbound within the
2 ms scheduling delay (a probe failure rolling back via remove, or a
fast rmmod after probe), the work fires after hid_destroy_device()
has dropped its reference and released the underlying hdev struct,
leaving cfg_setup() with a stale drvdata.hdev pointer.
Mirror the sibling driver hid-lenovo-go-s.c, whose hid_gos_cfg_remove()
already calls cancel_delayed_work_sync() on its analogous work, and
drain go_cfg_setup at the top of hid_go_cfg_remove(). The cancel
must come before guard(mutex)(&drvdata.cfg_mutex) because cfg_setup()
acquires that mutex; reversing the order would deadlock.
📍 영향받는 시스템
Linux kernel (hid-lenovo-go 드라이버가 포함된 버전)
⚔️ 공격 벡터
로컬 공격자가 장치를 빠르게 연결 및 해제(unbind/rmmod)하는 동작을 반복하여 커널 메모리 오류 유도
🛡️ 대응 방법
Linux 커널을 최신 보안 패치가 적용된 버전으로 업데이트하여 hid_go_cfg_remove() 내에 작업 취소 로직 적용
🔧 검증 코드
출력된 커널 버전이 해당 취약점이 수정된 패치 버전 이후인지 확인