🇰🇷 한글 설명
Linux 커널의 max3421 USB 허브 드라이버에서 max3421_hub_control() 함수가 요청의 value 값을 검증하지 않아 발생하는 shift-out-of-bounds 취약점입니다. 공격자가 특정 ioctl 요청을 통해 port_status의 비트를 임의로 조작하여 허브의 상태 체크를 우회할 수 있습니다.
💡 쉬운 설명
USB 허브를 제어하는 프로그램에서 숫자를 계산할 때 범위를 벗어나는 잘못된 계산이 발생합니다. 이를 통해 해커가 USB 장치의 상태를 마음대로 조작하여 보안 검사를 통과할 수 있습니다.
🇺🇸 원문 (English)
In the Linux kernel, the following vulnerability has been resolved:
usb: host: max3421: Fix shift-out-of-bounds in max3421_hub_control()
The `max3421_hub_control()` function handles USB hub class requests
to the virtual root hub. In the `default` branches of both the
`ClearPortFeature` and `SetPortFeature` switch statements, it modifies
`max3421_hcd->port_status` by left shifting 1 by the request's `value`
parameter. However, it does not validate whether this shift will exceed
the width of `port_status`.
So if a malicious userspace task with access to the root hub via
/dev/bus/usb/.../001 issues a USBDEVFS_CONTROL ioctl with `wValue`
greater than or equal to 32, the left shift operation invokes
shift-out-of-bounds undefined behavior. This results in arbitrary
bit corruption of `port_status`, including the normally-immutable
change bits, which can bypass internal state checks and confuse the
hub status.
Fix this by rejecting requests whose `value` exceeds the shift width
before performing the shift.
This issue was found using a KLEE-based symbolic execution tool for
kernel drivers that I'm currently developing.
📍 영향받는 시스템
max3421 드라이버를 사용하는 Linux 커널 시스템
⚔️ 공격 벡터
/dev/bus/usb/ 경로를 통해 USBDEVFS_CONTROL ioctl을 호출하는 로컬 사용자 공격
🛡️ 대응 방법
커널 패치를 적용하여 shift 연산 전 value 값이 허용 범위를 초과하는지 검증하도록 업데이트
🔧 검증 코드
출력된 커널 버전이 해당 취약점이 수정된 패치 버전인지 배포판 보안 공지를 통해 확인