All of lore.kernel.org
 help / color / mirror / Atom feed
From: Johan Hovold <johan@kernel.org>
To: Oliver Neukum <oneukum@suse.com>
Cc: linux-usb@vger.kernel.org, johan@kernel.org, stable@vger.kernel.org
Subject: Re: [PATCH] mct_u232: sanity checking in probe
Date: Wed, 16 Mar 2016 10:34:28 -0400	[thread overview]
Message-ID: <20160316143428.GA2546@localhost> (raw)
In-Reply-To: <1458134613-22159-1-git-send-email-oneukum@suse.com>

On Wed, Mar 16, 2016 at 02:23:33PM +0100, Oliver Neukum wrote:
> An attack using the lack of sanity checking in probe
> is known. This patch checks for the existance of a
> second port.
> CVE-2016-3136
> 
> Signed-off-by: Oliver Neukum <ONeukum@suse.com>
> CC: stable@vger.kernel.org
> ---
>  drivers/usb/serial/mct_u232.c | 4 ++++
>  1 file changed, 4 insertions(+)
> 
> diff --git a/drivers/usb/serial/mct_u232.c b/drivers/usb/serial/mct_u232.c
> index fd707d6..d6a36b1 100644
> --- a/drivers/usb/serial/mct_u232.c
> +++ b/drivers/usb/serial/mct_u232.c
> @@ -378,6 +378,10 @@ static int mct_u232_port_probe(struct usb_serial_port *port)
>  {
>  	struct mct_u232_private *priv;
>  
> +	/* check first to simplify error handling */
> +	if (!port->serial->port[1])
> +		return -ENODEV;
> +

This check is not sufficient as the second port's interrupt-in urb is
also unconditionally dereferenced below. Care to fix that up?

Ideally the existence of a second interrupt-in urb should have been
verified already at interface probe. But we can clean that up later.

>  	priv = kzalloc(sizeof(*priv), GFP_KERNEL);
>  	if (!priv)
>  		return -ENOMEM;

Thanks,
Johan

  reply	other threads:[~2016-03-16 14:33 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-03-16 13:23 [PATCH] mct_u232: sanity checking in probe Oliver Neukum
2016-03-16 14:34 ` Johan Hovold [this message]
  -- strict thread matches above, loose matches on Subject: below --
2016-03-17 10:38 Oliver Neukum
2016-03-17 14:47 ` Johan Hovold
2016-03-21 12:38   ` Oliver Neukum
2016-03-21 12:37 Oliver Neukum

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=20160316143428.GA2546@localhost \
    --to=johan@kernel.org \
    --cc=linux-usb@vger.kernel.org \
    --cc=oneukum@suse.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 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.