From: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
To: Seungjin Bae <eeodqql09@gmail.com>
Cc: Kyungtae Kim <Kyungtae.Kim@dartmouth.edu>,
Kees Cook <kees@kernel.org>,
Dan Carpenter <dan.carpenter@linaro.org>,
David Mosberger <davidm@egauge.net>,
linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] usb: host: max3421: Fix shift-out-of-bounds in max3421_hub_control()
Date: Mon, 18 May 2026 07:19:35 +0200 [thread overview]
Message-ID: <2026051801-manual-helper-c7b3@gregkh> (raw)
In-Reply-To: <CAAsoPpXhyaWp98Mge3zXz8a9XGJoL=MG-+iL3E=B7GBf_EVRmA@mail.gmail.com>
On Sun, May 17, 2026 at 02:19:07PM -0400, Seungjin Bae wrote:
> 2026년 5월 17일 (일) 오전 1:49, Greg Kroah-Hartman <gregkh@linuxfoundation.org>님이 작성:
> >
> > On Sat, May 16, 2026 at 08:01:46PM -0400, pip-izony wrote:
> > > From: Seungjin Bae <eeodqql09@gmail.com>
> > >
> > > 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.
> > >
> > > Fixes: 2d53139f3162 ("Add support for using a MAX3421E chip as a host driver.")
> > > Signed-off-by: Seungjin Bae <eeodqql09@gmail.com>
> > > ---
> > > drivers/usb/host/max3421-hcd.c | 4 ++++
> > > 1 file changed, 4 insertions(+)
> > >
> > > diff --git a/drivers/usb/host/max3421-hcd.c b/drivers/usb/host/max3421-hcd.c
> > > index 0e17c988d36a..3d6b351dcb1a 100644
> > > --- a/drivers/usb/host/max3421-hcd.c
> > > +++ b/drivers/usb/host/max3421-hcd.c
> > > @@ -1694,6 +1694,8 @@ max3421_hub_control(struct usb_hcd *hcd, u16 type_req, u16 value, u16 index,
> > > !pdata->vbus_active_level);
> > > fallthrough;
> > > default:
> > > + if (value >= 32)
> > > + goto error;
> >
> > Cool, what tool found this? I've been running some static checkers and
> > I don't think it turned this one up yet.
> >
> > thanks,
> >
> > greg k-h
>
> Thanks for your interest!
>
> It's a KLEE-based symbolic execution tool I've been developing for
> kernel drivers. It's still a work in progress, but I'd be happy to
> share more details and the tool itself once it's in better shape.
As per our documentation, you MUST document the fact that you are using
a tool to find/fix things. Please fix up our newly submitted patches to
include that information.
thanks,
greg k-h
next prev parent reply other threads:[~2026-05-18 5:19 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-05-17 0:01 [PATCH] usb: host: max3421: Fix shift-out-of-bounds in max3421_hub_control() pip-izony
2026-05-17 0:07 ` [PATCH v2] " pip-izony
2026-05-17 1:15 ` Alan Stern
2026-05-17 18:11 ` Seungjin Bae
2026-05-17 5:49 ` [PATCH] " Greg Kroah-Hartman
2026-05-17 18:19 ` Seungjin Bae
2026-05-18 5:19 ` Greg Kroah-Hartman [this message]
2026-05-17 19:03 ` [PATCH v3 1/2] " pip-izony
2026-05-17 19:03 ` [PATCH v3 2/2] usb: host: max3421: Reject hub port requests for non-existent ports pip-izony
2026-05-18 21:54 ` Alan Stern
2026-05-18 22:37 ` Seungjin Bae
2026-05-18 22:49 ` [PATCH v4 1/2] usb: host: max3421: Fix shift-out-of-bounds in max3421_hub_control() pip-izony
2026-05-18 22:49 ` [PATCH v4 2/2] usb: host: max3421: Reject hub port requests for non-existent ports pip-izony
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=2026051801-manual-helper-c7b3@gregkh \
--to=gregkh@linuxfoundation.org \
--cc=Kyungtae.Kim@dartmouth.edu \
--cc=dan.carpenter@linaro.org \
--cc=davidm@egauge.net \
--cc=eeodqql09@gmail.com \
--cc=kees@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-usb@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.