🇰🇷 한글 설명
리눅스 커널의 HID lg-g15 드라이버에서 장치 제거 시 대기 중인 작업이 취소되지 않아 발생하는 Use-After-Free 취약점입니다. 장치가 연결된 상태에서 작업이 예약된 후 갑자기 분리되면, 이미 해제된 메모리 영역에 접근을 시도하여 시스템 불안정이나 보안 문제를 일으킬 수 있습니다.
💡 쉬운 설명
키보드 같은 장치를 컴퓨터에서 갑자기 뽑을 때, 컴퓨터가 아직 처리 중인 작업이 남아 있어 오류가 발생하는 문제입니다. 이 과정에서 이미 사라진 메모리 정보를 다시 사용하려고 시도하면서 시스템에 문제가 생길 수 있습니다.
🇺🇸 원문 (English)
In the Linux kernel, the following vulnerability has been resolved:
HID: lg-g15: cancel pending work on remove to fix a use-after-free
lg_g15_data is allocated with devm and holds a work item. The report
handlers schedule that work straight from device input.
lg_g15_event() and lg_g15_v2_event() do it on the backlight cycle key,
and lg_g510_leds_event() does it too. The worker dereferences the
lg_g15_data back through container_of.
The driver had no remove callback and never cancelled the work. So if a
report scheduled the work and the keyboard was then unplugged, devres
freed lg_g15_data while the work was still pending or running, and the
worker touched freed memory. This is a use-after-free. It is reachable
as a race on device unplug.
Add a remove callback that cancels the work before devres frees the
state. g15->work is only initialized for the models that schedule it
(G15, G15 v2, G510). The G13 and Z-10 leave it zeroed, so guard the
cancel on g15->work.func to avoid cancelling a work that was never set
up. The g15 NULL test mirrors the one already in lg_g15_raw_event().
📍 영향받는 시스템
Linux kernel (HID lg-g15 driver components)
⚔️ 공격 벡터
장치 연결 해제 시 발생하는 레이스 컨디션(Race Condition)을 이용한 로컬 공격
🛡️ 대응 방법
리눅스 커널을 최신 보안 패치가 적용된 버전으로 업데이트하여 장치 제거 시 작업 취소 로직을 적용해야 합니다.
🔧 검증 코드
출력된 커널 버전이 해당 취약점이 수정된 패치 버전 이후인지 확인합니다.