From: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
To: Aditya Chari S <adi25charis@gmail.com>
Cc: Johan Hovold <johan@kernel.org>, Alex Elder <elder@kernel.org>,
greybus-dev@lists.linaro.org, linux-staging@lists.linux.dev,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH] greybus: usb: fix response buffer size for fixed-length hub requests
Date: Sat, 8 Aug 2026 07:46:23 +0200 [thread overview]
Message-ID: <2026080805-unsuited-sandy-ed29@gregkh> (raw)
In-Reply-To: <20260803010248.339120-1-adi25charis@gmail.com>
On Mon, Aug 03, 2026 at 06:32:48AM +0530, Aditya Chari S wrote:
> hub_control() sized the Greybus operation's response buffer purely
> off the caller-supplied wLength. However, per the USB hub class spec,
> GetHubDescriptor, GetHubStatus, and GetPortStatus have a response
> length that is fixed by the request type itself, and can be larger
> than (or independent of) whatever wLength the USB core happens to
> pass down. This could under-allocate the response buffer for these
> request types.
>
> Special-case these three request types so the response buffer is
> always large enough for the data the module will actually send back,
> matching the equivalent handling in usbcore's rh_call_control(). Fall
> back to wLength for all other request types, as before.
>
> Compile-tested with 'make M=drivers/staging/greybus C=1', including
> sparse, with no warnings. checkpatch --strict is also clean.
>
> Note: this driver's hub_control() is currently unreachable at runtime
> since gb_usb_probe() unconditionally disables USB support pending
> separate USB core changes. As Project Ara hardware is no longer
> available, this change has not been tested on physical hardware or
> with a Greybus module; it was verified only by compilation, sparse,
> and code review against the equivalent logic in usbcore.
>
> Signed-off-by: Aditya Chari S <adi25charis@gmail.com>
> ---
> drivers/staging/greybus/usb.c | 31 +++++++++++++++++++++++++++----
> 1 file changed, 27 insertions(+), 4 deletions(-)
Cool, what tool was used to find this? Did you forget the Assisted-by:
tag?
thanks,
greg k-h
next prev parent reply other threads:[~2026-08-08 5:46 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-08-03 1:02 [PATCH] greybus: usb: fix response buffer size for fixed-length hub requests Aditya Chari S
2026-08-08 5:46 ` Greg Kroah-Hartman [this message]
2026-08-08 8:19 ` Dan Carpenter
2026-08-03 23:51 ` Aditya Chari S
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=2026080805-unsuited-sandy-ed29@gregkh \
--to=gregkh@linuxfoundation.org \
--cc=adi25charis@gmail.com \
--cc=elder@kernel.org \
--cc=greybus-dev@lists.linaro.org \
--cc=johan@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-staging@lists.linux.dev \
/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.