🇰🇷 한글 설명
Linux 커널의 goku_udc 드라이버에서 USB 리셋 이벤트 발생 시 드라이버가 바인딩되지 않은 상태라면 NULL 포인터를 참조하여 시스템이 충돌할 수 있는 취약점입니다. INT_USBRESET 신호 처리 과정에서 dev->driver가 NULL인지 확인하지 않고 로그를 출력하려 할 때 발생합니다.
💡 쉬운 설명
USB 장치가 연결되거나 해제되는 과정에서 컴퓨터가 잘못된 메모리 주소를 읽으려고 시도하여 시스템이 멈추거나 오류가 발생할 수 있는 문제입니다. 드라이버가 준비되지 않은 상태에서 갑작스러운 신호가 들어올 때 발생하는 오류입니다.
🇺🇸 원문 (English)
In the Linux kernel, the following vulnerability has been resolved:
usb: gadget: goku_udc: avoid NULL deref of dev->driver in INT_USBRESET log
goku_irq() handles a number of bus events under a single ep0 path.
It already guards the gadget driver suspend/resume callbacks against a
NULL ->driver:
if (dev->gadget.speed != USB_SPEED_UNKNOWN
&& dev->driver
&& dev->driver->resume) {
spin_unlock(&dev->lock);
dev->driver->resume(&dev->gadget);
...
}
but the very next branch unconditionally dereferences dev->driver
when an INT_USBRESET arrives:
if (stat & INT_USBRESET) {
ACK(INT_USBRESET);
INFO(dev, "USB reset done, gadget %s\n",
dev->driver->driver.name);
}
If the controller raises INT_USBRESET before any gadget driver has
been bound (or after one has been unbound), dev->driver is NULL and
the printk dereferences NULL.
smatch flags the inconsistency:
drivers/usb/gadget/udc/goku_udc.c:1618 goku_irq() error:
we previously assumed 'dev->driver' could be null (see line 1607)
Fall back to a placeholder when the gadget driver is not bound.
No functional change while a gadget driver is bound.
📍 영향받는 시스템
Linux kernel (goku_udc 드라이버를 사용하는 시스템)
⚔️ 공격 벡터
물리적 또는 소프트웨어적으로 USB 리셋 신호를 강제로 발생시켜 NULL 포인터 역참조 유도
🛡️ 대응 방법
Linux 커널을 최신 보안 패치가 적용된 버전으로 업데이트하여 goku_udc의 NULL 체크 로직 적용
🔧 검증 코드
출력된 커널 버전이 해당 취약점이 수정된 패치 버전 이후인지 확인