mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Greg KH <gregkh@linuxfoundation.org>
To: Liu Chao <liuc63@xiaopeng.com>
Cc: linux-usb@vger.kernel.org, linuxppc-dev@lists.ozlabs.org,
	linux-kernel@vger.kernel.org, stable@vger.kernel.org,
	liuwb@xiaopeng.com
Subject: Re: [PATCH] usb: gadget: fsl_udc: validate pipe index in ch9getstatus()
Date: Fri, 20 Nov 2026 13:14:42 +0100	[thread overview]
Message-ID: <2026112032-cotton-hardly-d8db@gregkh> (raw)
In-Reply-To: <20260917123133.3760392-1-liuc63@xiaopeng.com>

On Thu, Sep 17, 2026 at 08:31:33PM +0800, Liu Chao wrote:
> ch9getstatus() uses get_pipe_by_windex() to compute a pipe index from
> the host-supplied wIndex field and then passes it to get_ep_by_pipe()
> to index the udc->eps[] array.  get_pipe_by_windex() can return up to
> 31, but udc->eps[] is allocated with udc->max_ep entries (typically
> 8-16 depending on the hardware).
> 
> The SET/CLEAR_FEATURE handler in the same function already checks
> 'pipe >= udc->max_ep' (line 1431) before indexing, but the GET_STATUS
> path omits this check, allowing an out-of-bounds access.
> 
> Add the same pipe >= max_ep guard to the GET_STATUS endpoint path,
> matching the existing check in the feature handler.
> 
> Fixes: b504882df105 ("USB: add Freescale high-speed USB SOC device controller driver")

Not a valid git id :(

      reply	other threads:[~2026-11-20 12:14 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-09-17 12:31 Liu Chao
2026-11-20 12:14 ` Greg KH [this message]

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=2026112032-cotton-hardly-d8db@gregkh \
    --to=gregkh@linuxfoundation.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-usb@vger.kernel.org \
    --cc=linuxppc-dev@lists.ozlabs.org \
    --cc=liuc63@xiaopeng.com \
    --cc=liuwb@xiaopeng.com \
    --cc=stable@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®