From: sashiko-bot@kernel.org
To: "Shunbo Shi" <shishunbo@cmss.chinamobile.com>
Cc: linux-usb@vger.kernel.org
Subject: Re: [PATCH 11/22] usb: host: fix a few spelling mistakes in comments
Date: Tue, 10 Nov 2026 06:45:58 +0000 [thread overview]
Message-ID: <sashiko-outbox-206443@kernel.org> (raw)
In-Reply-To: <20261110064105.20335-12-shishunbo@cmss.chinamobile.com>
Thank you for your contribution! Sashiko AI review found no new issues
in this patch, but noticed 1 related pre-existing issue it does not
introduce:
- [Medium] usb: xhci: shift-out-of-bounds in xhci_endpoint_init() [1]
--
commit a988b8e7693dc7d03153a0ed5cd6c269e329c0d7
Author: Shunbo Shi <shishunbo@cmss.chinamobile.com>
usb: host: fix a few spelling mistakes in comments
This commit fixes spelling mistakes in comments across several USB host
controller drivers.
[ ... ]
> diff --git a/drivers/usb/host/xhci-mem.c b/drivers/usb/host/xhci-mem.c
> index 75577f441cddc..d92d6a95264b0 100644
> --- a/drivers/usb/host/xhci-mem.c
> +++ b/drivers/usb/host/xhci-mem.c
> @@ -1442,7 +1442,7 @@ int xhci_endpoint_init(struct xhci_hcd *xhci,
>
> /*
> * Get values to fill the endpoint context, mostly from ep descriptor.
> - * The average TRB buffer lengt for bulk endpoints is unclear as we
> + * The average TRB buffer length for bulk endpoints is unclear as we
> * have no clue on scatter gather list entry size. For Isoc and Int,
> * set it to max available. See xHCI 1.1 spec 4.14.1.1 for details.
> */
[Severity: Medium]
This problem wasn't introduced by this patch, but can a full-speed bulk
endpoint with wMaxPacketSize of 0 trigger a shift-out-of-bounds in
rounddown_pow_of_two() further down in xhci_endpoint_init() [1]?
drivers/usb/host/xhci-mem.c:xhci_endpoint_init() {
...
max_packet = xhci_usb_endpoint_maxp(udev, ep);
...
if (usb_endpoint_xfer_bulk(&ep->desc)) {
if (udev->speed == USB_SPEED_HIGH)
max_packet = 512;
if (udev->speed == USB_SPEED_FULL) {
max_packet = rounddown_pow_of_two(max_packet);
max_packet = clamp_val(max_packet, 8, 64);
}
}
...
}
usb_parse_endpoint() logs a notice when wMaxPacketSize is 0 without rejecting
the descriptor. When xhci_endpoint_init() runs on such an endpoint,
max_packet is 0 and rounddown_pow_of_two(0) evaluates 1UL << -1 before
clamp_val() runs, triggering a UBSAN shift-out-of-bounds warning and
producing an architecture-dependent max_packet value. Clamping max_packet
before calling rounddown_pow_of_two() would avoid this.
[1] https://sashiko.dev/#/bug/linux-8c242134-4dc4-4170-867f-fb3afd236e9c
--
Sashiko AI review · https://sashiko.dev/#/patchset/20261110064105.20335-1-shishunbo@cmss.chinamobile.com?part=11
next prev parent reply other threads:[~2026-11-10 6:45 UTC|newest]
Thread overview: 91+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-10 6:40 [PATCH 00/22] usb: fix spelling mistakes in comments Shunbo Shi
2026-11-10 6:40 ` [PATCH 01/22] usb: atm: fix a few " Shunbo Shi
2026-11-10 6:43 ` sashiko-bot
2026-11-10 6:40 ` [PATCH 02/22] usb: cdns3: " Shunbo Shi
2026-11-10 6:44 ` sashiko-bot
2026-11-10 6:40 ` [PATCH 03/22] usb: chipidea: " Shunbo Shi
2026-11-10 6:43 ` sashiko-bot
2026-11-10 6:40 ` [PATCH 04/22] usb: class: " Shunbo Shi
2026-11-10 6:43 ` sashiko-bot
2026-11-10 6:40 ` [PATCH 05/22] usb: common: " Shunbo Shi
2026-11-10 6:43 ` sashiko-bot
2026-11-10 6:40 ` [PATCH 06/22] usb: core: " Shunbo Shi
2026-11-10 6:44 ` sashiko-bot
2026-11-10 6:40 ` [PATCH 07/22] usb: dwc2: " Shunbo Shi
2026-11-10 6:44 ` sashiko-bot
2026-11-10 6:40 ` [PATCH 08/22] usb: dwc3: " Shunbo Shi
2026-11-10 6:48 ` sashiko-bot
2026-11-10 6:40 ` [PATCH 09/22] usb: fotg210: " Shunbo Shi
2026-11-10 6:43 ` sashiko-bot
2026-11-10 6:40 ` [PATCH 10/22] usb: gadget: " Shunbo Shi
2026-11-10 6:49 ` sashiko-bot
2026-11-10 6:40 ` [PATCH 11/22] usb: host: " Shunbo Shi
2026-11-10 6:45 ` sashiko-bot [this message]
2026-11-10 6:40 ` [PATCH 12/22] usb: image: " Shunbo Shi
2026-11-10 6:44 ` sashiko-bot
2026-11-10 6:40 ` [PATCH 13/22] usb: isp1760: " Shunbo Shi
2026-11-10 6:43 ` sashiko-bot
2026-11-10 6:40 ` [PATCH 14/22] usb: misc: " Shunbo Shi
2026-11-10 6:45 ` sashiko-bot
2026-11-10 6:40 ` [PATCH 15/22] usb: musb: " Shunbo Shi
2026-11-10 6:44 ` sashiko-bot
2026-11-10 6:40 ` [PATCH 16/22] usb: phy: " Shunbo Shi
2026-11-10 6:44 ` sashiko-bot
2026-11-10 6:41 ` [PATCH 17/22] usb: renesas_usbhs: " Shunbo Shi
2026-11-10 6:45 ` sashiko-bot
2026-11-10 6:41 ` [PATCH 18/22] usb: roles: " Shunbo Shi
2026-11-10 6:45 ` sashiko-bot
2026-11-10 6:41 ` [PATCH 19/22] usb: serial: " Shunbo Shi
2026-11-10 6:45 ` sashiko-bot
2026-11-10 6:41 ` [PATCH 20/22] usb: storage: " Shunbo Shi
2026-11-10 6:44 ` sashiko-bot
2026-11-10 6:41 ` [PATCH 21/22] usb: typec: " Shunbo Shi
2026-11-10 6:46 ` sashiko-bot
2026-11-10 6:41 ` [PATCH 22/22] usb: usbip: " Shunbo Shi
2026-11-10 6:46 ` sashiko-bot
2026-11-10 7:58 ` [PATCH v2 00/22] usb: fix " Shunbo Shi
2026-11-10 7:58 ` [PATCH v2 01/22] usb: atm: fix a few " Shunbo Shi
2026-11-10 23:29 ` sashiko-bot
2026-11-10 7:58 ` [PATCH v2 02/22] usb: cdns3: " Shunbo Shi
2026-11-10 23:29 ` sashiko-bot
2026-11-10 7:58 ` [PATCH v2 03/22] usb: chipidea: " Shunbo Shi
2026-11-10 23:29 ` sashiko-bot
2026-11-10 7:58 ` [PATCH v2 04/22] usb: class: " Shunbo Shi
2026-11-10 23:30 ` sashiko-bot
2026-11-10 7:58 ` [PATCH v2 05/22] usb: common: " Shunbo Shi
2026-11-10 23:30 ` sashiko-bot
2026-11-10 7:58 ` [PATCH v2 06/22] usb: core: " Shunbo Shi
2026-11-10 23:32 ` sashiko-bot
2026-11-10 7:58 ` [PATCH v2 07/22] usb: dwc2: " Shunbo Shi
2026-11-10 23:31 ` sashiko-bot
2026-11-10 7:58 ` [PATCH v2 08/22] usb: dwc3: " Shunbo Shi
2026-11-10 23:31 ` sashiko-bot
2026-11-10 7:58 ` [PATCH v2 09/22] usb: fotg210: " Shunbo Shi
2026-11-10 23:31 ` sashiko-bot
2026-11-10 7:58 ` [PATCH v2 10/22] usb: gadget: " Shunbo Shi
2026-11-10 23:32 ` sashiko-bot
2026-11-10 7:58 ` [PATCH v2 11/22] usb: host: " Shunbo Shi
2026-11-10 8:45 ` Michal Pecio
2026-11-10 23:32 ` sashiko-bot
2026-11-10 7:58 ` [PATCH v2 12/22] usb: image: " Shunbo Shi
2026-11-10 23:32 ` sashiko-bot
2026-11-10 7:58 ` [PATCH v2 13/22] usb: isp1760: " Shunbo Shi
2026-11-10 23:32 ` sashiko-bot
2026-11-10 7:58 ` [PATCH v2 14/22] usb: misc: " Shunbo Shi
2026-11-10 23:33 ` sashiko-bot
2026-11-10 7:58 ` [PATCH v2 15/22] usb: musb: " Shunbo Shi
2026-11-10 23:32 ` sashiko-bot
2026-11-10 7:58 ` [PATCH v2 16/22] usb: phy: " Shunbo Shi
2026-11-10 23:33 ` sashiko-bot
2026-11-10 7:58 ` [PATCH v2 17/22] usb: renesas_usbhs: " Shunbo Shi
2026-11-10 23:33 ` sashiko-bot
2026-11-10 7:58 ` [PATCH v2 18/22] usb: roles: " Shunbo Shi
2026-11-10 23:34 ` sashiko-bot
2026-11-10 7:58 ` [PATCH v2 19/22] usb: serial: " Shunbo Shi
2026-11-10 23:33 ` sashiko-bot
2026-11-10 7:58 ` [PATCH v2 20/22] usb: storage: " Shunbo Shi
2026-11-10 23:33 ` sashiko-bot
2026-11-10 7:58 ` [PATCH v2 21/22] usb: typec: " Shunbo Shi
2026-11-10 23:34 ` sashiko-bot
2026-11-10 7:58 ` [PATCH v2 22/22] usb: usbip: " Shunbo Shi
2026-11-10 23:34 ` sashiko-bot
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=sashiko-outbox-206443@kernel.org \
--to=sashiko-bot@kernel.org \
--cc=linux-usb@vger.kernel.org \
--cc=sashiko-reviews@lists.linux.dev \
--cc=shishunbo@cmss.chinamobile.com \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox