From: sashiko-bot@kernel.org
To: "Fang Xieyan" <fangxy@xiaopeng.com>
Cc: linux-usb@vger.kernel.org
Subject: Re: [PATCH] usb: dwc2: gadget: fix off-by-one in ep_from_windex bounds check
Date: Mon, 26 Oct 2026 03:48:43 +0000 [thread overview]
Message-ID: <sashiko-outbox-184608@kernel.org> (raw)
In-Reply-To: <20261026031138.35911-1-fangxy@xiaopeng.com>
> ep_from_windex() uses idx > hsotg->num_of_eps to validate the
> endpoint index. Since valid indices are below num_of_eps, an index
> equal to num_of_eps passes the check and is used to access
> eps_in[] or eps_out[] out of bounds. This can cause an unintended
> endpoint pointer to be used by subsequent request handling.
>
> Reject indices greater than or equal to num_of_eps to prevent the
> out-of-bounds access.
>
> Fixes: b3f489b2b658 ("usb:hsotg:samsung: Determine number of EPs from HW configuration register")
> Reviewed-by: Guanglei Zhu <zhugl3@xiaopeng.com>
> Signed-off-by: Fang Xieyan <fangxy@xiaopeng.com>
Sashiko has reviewed this patch and found no issues.
--
Sashiko AI review · https://sashiko.dev/#/patchset/20261026031138.35911-1-fangxy@xiaopeng.com?part=1
next prev parent reply other threads:[~2026-10-26 3:48 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-10-26 3:11 [PATCH] usb: dwc2: gadget: fix off-by-one in ep_from_windex bounds check Fang Xieyan
2026-10-26 3:48 ` sashiko-bot [this message]
2026-10-26 7:26 ` Fang Xieyan
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-184608@kernel.org \
--to=sashiko-bot@kernel.org \
--cc=fangxy@xiaopeng.com \
--cc=linux-usb@vger.kernel.org \
--cc=sashiko-reviews@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox