linux-usb.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
To: Johan Hovold <johan@kernel.org>
Cc: linux-usb@vger.kernel.org,
	Rainer Weikusat <rainer.weikusat@sncag.com>,
	stable <stable@vger.kernel.org>
Subject: Re: [PATCH] USB: serial: keyspan: fix NULL-derefs on open() and write()
Date: Fri, 4 Oct 2019 10:54:48 +0200	[thread overview]
Message-ID: <20191004085448.GA267760@kroah.com> (raw)
In-Reply-To: <20191003134958.8692-1-johan@kernel.org>

On Thu, Oct 03, 2019 at 03:49:58PM +0200, Johan Hovold wrote:
> Fix NULL-pointer dereferences on open() and write() which can be
> triggered by a malicious USB device.
> 
> The current URB allocation helper would fail to initialise the newly
> allocated URB if the device has unexpected endpoint descriptors,
> something which could lead NULL-pointer dereferences in a number of
> open() and write() paths when accessing the URB. For example:
> 
> 	BUG: kernel NULL pointer dereference, address: 0000000000000000
> 	...
> 	RIP: 0010:usb_clear_halt+0x11/0xc0
> 	...
> 	Call Trace:
> 	 ? tty_port_open+0x4d/0xd0
> 	 keyspan_open+0x70/0x160 [keyspan]
> 	 serial_port_activate+0x5b/0x80 [usbserial]
> 	 tty_port_open+0x7b/0xd0
> 	 ? check_tty_count+0x43/0xa0
> 	 tty_open+0xf1/0x490
> 
> 	BUG: kernel NULL pointer dereference, address: 0000000000000000
> 	...
> 	RIP: 0010:keyspan_write+0x14e/0x1f3 [keyspan]
> 	...
> 	Call Trace:
> 	 serial_write+0x43/0xa0 [usbserial]
> 	 n_tty_write+0x1af/0x4f0
> 	 ? do_wait_intr_irq+0x80/0x80
> 	 ? process_echoes+0x60/0x60
> 	 tty_write+0x13f/0x2f0
> 
> 	BUG: kernel NULL pointer dereference, address: 0000000000000000
> 	...
> 	RIP: 0010:keyspan_usa26_send_setup+0x298/0x305 [keyspan]
> 	...
> 	Call Trace:
> 	 keyspan_open+0x10f/0x160 [keyspan]
> 	 serial_port_activate+0x5b/0x80 [usbserial]
> 	 tty_port_open+0x7b/0xd0
> 	 ? check_tty_count+0x43/0xa0
> 	 tty_open+0xf1/0x490
> 
> Fixes: fdcba53e2d58 ("fix for bugzilla #7544 (keyspan USB-to-serial converter)")
> Cc: stable <stable@vger.kernel.org>	# 2.6.21
> Signed-off-by: Johan Hovold <johan@kernel.org>

Reviewed-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

      reply	other threads:[~2019-10-04  8:54 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-10-03 13:49 [PATCH] USB: serial: keyspan: fix NULL-derefs on open() and write() Johan Hovold
2019-10-04  8:54 ` Greg Kroah-Hartman [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=20191004085448.GA267760@kroah.com \
    --to=gregkh@linuxfoundation.org \
    --cc=johan@kernel.org \
    --cc=linux-usb@vger.kernel.org \
    --cc=rainer.weikusat@sncag.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;
as well as URLs for NNTP newsgroup(s).