🇰🇷 한글 설명
Linux 커널의 usb gadget u_ether 구성 요소에서 eth_get_drvinfo 함수 호출 시 NULL 포인터 역참조가 발생하는 취약점입니다. 장치가 언바인드(unbind)되는 과정에서 가젯 포인터가 초기화되는데, 이 시점에 사용자 공간 도구가 인터페이스를 조회하면 커널 패닉이 발생할 수 있습니다.
💡 쉬운 설명
컴퓨터의 USB 연결 장치가 해제되는 찰나에 정보를 요청하면 시스템이 길을 잃고 멈춰버리는 오류입니다. 이로 인해 시스템이 갑자기 재부팅되거나 중단될 수 있습니다.
🇺🇸 원문 (English)
In the Linux kernel, the following vulnerability has been resolved:
usb: gadget: u_ether: Fix NULL pointer deref in eth_get_drvinfo
Commit ec35c1969650 ("usb: gadget: f_ncm: Fix net_device lifecycle with
device_move") reparents the gadget device to /sys/devices/virtual during
unbind, clearing the gadget pointer. If the userspace tool queries on
the surviving interface during this detached window, this leads to a
NULL pointer dereference.
Unable to handle kernel NULL pointer dereference
Call trace:
eth_get_drvinfo+0x50/0x90
ethtool_get_drvinfo+0x5c/0x1f0
__dev_ethtool+0xaec/0x1fe0
dev_ethtool+0x134/0x2e0
dev_ioctl+0x338/0x560
Add a NULL check for dev->gadget in eth_get_drvinfo(). When detached,
skip copying the fw_version and bus_info strings, which is natively
handled by ethtool_get_drvinfo for empty strings.
📍 영향받는 시스템
Linux kernel (usb: gadget: u_ether 관련 모듈 사용 시스템)
⚔️ 공격 벡터
장치 해제(unbind) 시점에 사용자 공간 도구(ethtool 등)를 통해 특정 ioctl 요청을 보내는 방식
🛡️ 대응 방법
커널 패치를 적용하여 eth_get_drvinfo() 함수 내에 dev->gadget에 대한 NULL 체크 로직을 추가해야 합니다.
🔧 검증 코드
출력된 커널 버전이 해당 취약점이 수정된 패치 버전 이후인지 확인합니다.