summaryrefslogtreecommitdiff
path: root/rust/zerocopy/src/pointer/git@git.tavy.me:linux-stable.git
diff options
context:
space:
mode:
authorSeungjin Bae <eeodqql09@gmail.com>2026-05-18 18:49:00 -0400
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2026-05-22 11:35:18 +0200
commitcff06b03b530ae1fe8a13e93a7848f2130e00fb4 (patch)
treebbe35587e5e5e1e5ba1e5bbf814b22aff2abfe14 /rust/zerocopy/src/pointer/git@git.tavy.me:linux-stable.git
parent8c22256bbafad3dc5fdbe9f684d045b67ff06a68 (diff)
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. Fixes: 2d53139f3162 ("Add support for using a MAX3421E chip as a host driver.") Signed-off-by: Seungjin Bae <eeodqql09@gmail.com> Link: https://patch.msgid.link/20260518224901.1887013-1-eeodqql09@gmail.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'rust/zerocopy/src/pointer/git@git.tavy.me:linux-stable.git')
0 files changed, 0 insertions, 0 deletions