🇰🇷 한글 설명
Linux 커널의 USB 코어에서 제어 엔드포인트를 비활성화할 때, 입력과 출력 엔드포인트 포인터를 모두 초기화하지 않는 취약점이 발견되었습니다. 이로 인해 비활성화되거나 해제된 엔드포인트를 가리키는 잘못된 포인터가 남아 메모리 관리 오류를 유발할 수 있습니다.
💡 쉬운 설명
USB 장치를 연결하거나 해제할 때, 컴퓨터가 사용하던 통로 정보를 깨끗이 지우지 않아 발생하는 문제입니다. 이로 인해 시스템이 잘못된 정보를 참조하여 오류가 발생하거나 불안정해질 수 있습니다.
🇺🇸 원문 (English)
In the Linux kernel, the following vulnerability has been resolved:
usb: core: clear both ep_in and ep_out for non-ep0 control endpoints
In usb_enable_endpoint(), non-zero control endpoints (where
usb_endpoint_xfer_control(&ep->desc) is true) populate both
dev->ep_in[epnum] and dev->ep_out[epnum] with the same struct
usb_host_endpoint pointer.
However, usb_disable_endpoint() only clears either dev->ep_out[epnum] or
dev->ep_in[epnum] depending on the direction bit of epaddr when
reset_hardware is set, leaving the opposite direction's array slot
pointing to the disabled/freed endpoint.
Clear both dev->ep_out[epnum] and dev->ep_in[epnum] when disabling a
non-ep0 control endpoint with reset_hardware set, and update the
function kerneldoc accordingly.
Tested in QEMU against Linux 7.3.0-rc3 using dummy_hcd and raw-gadget to
enumerate a USB device with a non-zero control endpoint
(bEndpointAddress 0x01, bmAttributes USB_ENDPOINT_XFER_CONTROL),
verifying that both dev->ep_in[1] and dev->ep_out[1] are cleared when
the interface is disabled.
📍 영향받는 시스템
Linux kernel (USB core module, 7.3.0-rc3 이전 버전)
⚔️ 공격 벡터
특수하게 조작된 USB 장치를 연결하여 엔드포인트를 반복적으로 활성화 및 비활성화함으로써 발생
🛡️ 대응 방법
Linux 커널을 최신 보안 패치가 적용된 버전으로 업데이트하여 usb_disable_endpoint() 함수 수정 사항을 반영해야 함
🔧 검증 코드
출력된 커널 버전이 취약점이 해결된 패치 버전 이후인지 확인