stable.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Johan Hovold <johan@kernel.org>
To: linux-usb@vger.kernel.org
Cc: Johan Hovold <johan@kernel.org>, stable <stable@vger.kernel.org>
Subject: [PATCH 24/24] USB: serial: ti_usb_3410_5052: fix NULL-deref at open
Date: Tue,  3 Jan 2017 16:40:03 +0100	[thread overview]
Message-ID: <20170103154003.31860-25-johan@kernel.org> (raw)
In-Reply-To: <20170103154003.31860-1-johan@kernel.org>

Fix NULL-pointer dereference in open() should a malicious device lack
the expected endpoints:

Unable to handle kernel NULL pointer dereference at virtual address 00000030
..
[<bf06a6b0>] (ti_open [ti_usb_3410_5052]) from [<bf02e118>] (serial_port_activate+0x68/0x98 [usbserial])

Fixes: 1da177e4c3f4 ("Linux-2.6.12-rc2")
Cc: stable <stable@vger.kernel.org>
Signed-off-by: Johan Hovold <johan@kernel.org>
---
 drivers/usb/serial/ti_usb_3410_5052.c | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/drivers/usb/serial/ti_usb_3410_5052.c b/drivers/usb/serial/ti_usb_3410_5052.c
index 8db9d071d940..64b85b8dedf3 100644
--- a/drivers/usb/serial/ti_usb_3410_5052.c
+++ b/drivers/usb/serial/ti_usb_3410_5052.c
@@ -579,6 +579,13 @@ static int ti_startup(struct usb_serial *serial)
 		goto free_tdev;
 	}
 
+	if (serial->num_bulk_in < serial->num_ports ||
+			serial->num_bulk_out < serial->num_ports) {
+		dev_err(&serial->interface->dev, "missing endpoints\n");
+		status = -ENODEV;
+		goto free_tdev;
+	}
+
 	return 0;
 
 free_tdev:
-- 
2.10.2


      parent reply	other threads:[~2017-01-03 15:41 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <20170103154003.31860-1-johan@kernel.org>
2017-01-03 15:39 ` [PATCH 01/24] USB: serial: cyberjack: fix NULL-deref at open Johan Hovold
2017-01-03 16:27   ` Greg KH
2017-01-03 16:48     ` Johan Hovold
2017-01-03 16:55       ` Greg KH
2017-01-03 15:39 ` [PATCH 02/24] USB: serial: garmin_gps: fix memory leak on failed URB submit Johan Hovold
2017-01-03 15:39 ` [PATCH 03/24] USB: serial: io_edgeport: fix NULL-deref at open Johan Hovold
2017-01-03 15:39 ` [PATCH 04/24] USB: serial: io_ti: " Johan Hovold
2017-01-03 15:39 ` [PATCH 05/24] USB: serial: io_ti: fix another " Johan Hovold
2017-01-03 15:39 ` [PATCH 06/24] USB: serial: io_ti: fix I/O after disconnect Johan Hovold
2017-01-03 15:39 ` [PATCH 08/24] USB: serial: iuu_phoenix: fix NULL-deref at open Johan Hovold
2017-01-03 15:39 ` [PATCH 09/24] USB: serial: keyspan_pda: verify endpoints at probe Johan Hovold
2017-01-03 15:39 ` [PATCH 10/24] USB: serial: kobil_sct: fix NULL-deref in write Johan Hovold
2017-01-03 15:39 ` [PATCH 11/24] USB: serial: mos7720: fix NULL-deref at open Johan Hovold
2017-01-03 15:39 ` [PATCH 12/24] USB: serial: mos7720: fix use-after-free on probe errors Johan Hovold
2017-01-03 15:39 ` [PATCH 13/24] USB: serial: mos7720: fix parport " Johan Hovold
2017-01-03 15:39 ` [PATCH 14/24] USB: serial: mos7720: fix parallel probe Johan Hovold
2017-01-03 15:39 ` [PATCH 16/24] USB: serial: mos7840: fix NULL-deref at open Johan Hovold
2017-01-03 15:39 ` [PATCH 19/24] USB: serial: omninet: fix NULL-derefs at open and disconnect Johan Hovold
2017-01-03 15:39 ` [PATCH 20/24] USB: serial: oti6858: fix NULL-deref at open Johan Hovold
2017-01-03 15:40 ` [PATCH 21/24] USB: serial: pl2303: " Johan Hovold
2017-01-03 15:40 ` [PATCH 22/24] USB: serial: quatech2: fix sleep-while-atomic in close Johan Hovold
2017-01-03 15:40 ` [PATCH 23/24] USB: serial: spcp8x5: fix NULL-deref at open Johan Hovold
2017-01-03 15:40 ` Johan Hovold [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=20170103154003.31860-25-johan@kernel.org \
    --to=johan@kernel.org \
    --cc=linux-usb@vger.kernel.org \
    --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).