linux-usb.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Bin Liu <b-liu@ti.com>
To: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: linux-usb@vger.kernel.org
Subject: usb: musb: gadget: misplaced out of bounds check
Date: Thu, 29 Mar 2018 11:51:10 -0500	[thread overview]
Message-ID: <20180329165110.GA14921@uda0271908> (raw)

On Thu, Mar 29, 2018 at 06:36:42PM +0200, Greg Kroah-Hartman wrote:
> On Thu, Mar 29, 2018 at 10:48:28AM -0500, Bin Liu wrote:
> > From: Heinrich Schuchardt <xypron.glpk@gmx.de>
> > 
> > musb->endpoints[] has array size MUSB_C_NUM_EPS.
> > We must check array bounds before accessing the array and not afterwards.
> > 
> > Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
> > Signed-off-by: Bin Liu <b-liu@ti.com>
> > ---
> >  drivers/usb/musb/musb_gadget_ep0.c | 14 +++++++++-----
> >  1 file changed, 9 insertions(+), 5 deletions(-)
> 
> Should this also go to the stable kernels?

Your call. My understanding is this is just a potential, and the code
looks wrong - checking the boundary after used it, but the ep index
won't be able to over the boundary anyway. Though I don't have enough
security knowledge to judge if the bug has an security hole...

Regards,
-Bin.
---
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

             reply	other threads:[~2018-03-29 16:51 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-03-29 16:51 Bin Liu [this message]
  -- strict thread matches above, loose matches on Subject: below --
2018-03-29 16:36 usb: musb: gadget: misplaced out of bounds check Greg Kroah-Hartman
2018-03-29 15:48 Bin Liu

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=20180329165110.GA14921@uda0271908 \
    --to=b-liu@ti.com \
    --cc=gregkh@linuxfoundation.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).