All of lore.kernel.org
 help / color / mirror / Atom feed
From: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
To: sathyanarayanan.kuppuswamy@linux.intel.com
Cc: johan@kernel.org, linux-usb@vger.kernel.org,
	linux-kernel@vger.kernel.org
Subject: [v1,1/1] USB: serial: Add boundry check for read_urbs array access
Date: Wed, 7 Mar 2018 12:58:40 -0800	[thread overview]
Message-ID: <20180307205840.GA6242@kroah.com> (raw)

On Wed, Mar 07, 2018 at 12:23:56PM -0800, sathyanarayanan.kuppuswamy@linux.intel.com wrote:
> From: Kuppuswamy Sathyanarayanan <sathyanarayanan.kuppuswamy@linux.intel.com>
> 
> In usb_serial_generic_submit_read_urb() function we are accessing the
> port->read_urbs array without any boundry checks. This might lead to
> kernel panic when index value goes above array length.
> 
> One posible call path for this issue is,
> 
> usb_serial_generic_read_bulk_callback()
> {
>  ...
>  if (!port->throttled) {
> 	usb_serial_generic_submit_read_urb(port, i, GFP_ATOMIC);
>  ...
> }

How does i ever get to be greater than the array size here in this
function?  It directly came from looking in that array in the first
place :)

So I don't see why your check is needed, what other code path would ever
call this function in a way that the bounds check would be needed?

thanks,

greg k-h
---
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

WARNING: multiple messages have this Message-ID (diff)
From: Greg KH <gregkh@linuxfoundation.org>
To: sathyanarayanan.kuppuswamy@linux.intel.com
Cc: johan@kernel.org, linux-usb@vger.kernel.org,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH v1 1/1] USB: serial: Add boundry check for read_urbs array access
Date: Wed, 7 Mar 2018 12:58:40 -0800	[thread overview]
Message-ID: <20180307205840.GA6242@kroah.com> (raw)
In-Reply-To: <f48feae7582a5669422066b4821a9e310eebc9ba.1520454192.git.sathyanarayanan.kuppuswamy@linux.intel.com>

On Wed, Mar 07, 2018 at 12:23:56PM -0800, sathyanarayanan.kuppuswamy@linux.intel.com wrote:
> From: Kuppuswamy Sathyanarayanan <sathyanarayanan.kuppuswamy@linux.intel.com>
> 
> In usb_serial_generic_submit_read_urb() function we are accessing the
> port->read_urbs array without any boundry checks. This might lead to
> kernel panic when index value goes above array length.
> 
> One posible call path for this issue is,
> 
> usb_serial_generic_read_bulk_callback()
> {
>  ...
>  if (!port->throttled) {
> 	usb_serial_generic_submit_read_urb(port, i, GFP_ATOMIC);
>  ...
> }

How does i ever get to be greater than the array size here in this
function?  It directly came from looking in that array in the first
place :)

So I don't see why your check is needed, what other code path would ever
call this function in a way that the bounds check would be needed?

thanks,

greg k-h

             reply	other threads:[~2018-03-07 20:58 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-03-07 20:58 Greg Kroah-Hartman [this message]
2018-03-07 20:58 ` [PATCH v1 1/1] USB: serial: Add boundry check for read_urbs array access Greg KH
  -- strict thread matches above, loose matches on Subject: below --
2018-03-09  0:34 [v1,1/1] " sathyanarayanan.kuppuswamy
2018-03-09  0:34 ` [PATCH v1 1/1] " sathyanarayanan kuppuswamy
2018-03-08 23:43 [v1,1/1] " Greg Kroah-Hartman
2018-03-08 23:43 ` [PATCH v1 1/1] " Greg KH
2018-03-08 23:29 [v1,1/1] " sathyanarayanan.kuppuswamy
2018-03-08 23:29 ` [PATCH v1 1/1] " sathyanarayanan kuppuswamy
2018-03-08 14:01 [v1,1/1] " Greg Kroah-Hartman
2018-03-08 14:01 ` [PATCH v1 1/1] " Greg KH
2018-03-08  8:54 [v1,1/1] " Oliver Neukum
2018-03-08  8:54 ` [PATCH v1 1/1] " Oliver Neukum
2018-03-07 21:41 [v1,1/1] " sathyanarayanan.kuppuswamy
2018-03-07 21:41 ` [PATCH v1 1/1] " sathyanarayanan kuppuswamy
2018-03-07 20:23 [v1,1/1] " sathyanarayanan.kuppuswamy
2018-03-07 20:23 ` [PATCH v1 1/1] " sathyanarayanan.kuppuswamy

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=20180307205840.GA6242@kroah.com \
    --to=gregkh@linuxfoundation.org \
    --cc=johan@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-usb@vger.kernel.org \
    --cc=sathyanarayanan.kuppuswamy@linux.intel.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 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.