All of lore.kernel.org
 help / color / mirror / Atom feed
* Patch "USB: iowarrior: fix NULL-deref at probe" has been added to the 4.4-stable tree
@ 2017-03-15  7:58 gregkh
  0 siblings, 0 replies; only message in thread
From: gregkh @ 2017-03-15  7:58 UTC (permalink / raw)
  To: johan, gregkh; +Cc: stable, stable-commits


This is a note to let you know that I've just added the patch titled

    USB: iowarrior: fix NULL-deref at probe

to the 4.4-stable tree which can be found at:
    http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary

The filename of the patch is:
     usb-iowarrior-fix-null-deref-at-probe.patch
and it can be found in the queue-4.4 subdirectory.

If you, or anyone else, feels it should not be added to the stable tree,
please let <stable@vger.kernel.org> know about it.


>From b7321e81fc369abe353cf094d4f0dc2fe11ab95f Mon Sep 17 00:00:00 2001
From: Johan Hovold <johan@kernel.org>
Date: Tue, 7 Mar 2017 16:11:03 +0100
Subject: USB: iowarrior: fix NULL-deref at probe

From: Johan Hovold <johan@kernel.org>

commit b7321e81fc369abe353cf094d4f0dc2fe11ab95f upstream.

Make sure to check for the required interrupt-in endpoint to avoid
dereferencing a NULL-pointer should a malicious device lack such an
endpoint.

Note that a fairly recent change purported to fix this issue, but added
an insufficient test on the number of endpoints only, a test which can
now be removed.

Fixes: 4ec0ef3a8212 ("USB: iowarrior: fix oops with malicious USB descriptors")
Fixes: 946b960d13c1 ("USB: add driver for iowarrior devices.")
Signed-off-by: Johan Hovold <johan@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

---
 drivers/usb/misc/iowarrior.c |   13 +++++++------
 1 file changed, 7 insertions(+), 6 deletions(-)

--- a/drivers/usb/misc/iowarrior.c
+++ b/drivers/usb/misc/iowarrior.c
@@ -787,12 +787,6 @@ static int iowarrior_probe(struct usb_in
 	iface_desc = interface->cur_altsetting;
 	dev->product_id = le16_to_cpu(udev->descriptor.idProduct);
 
-	if (iface_desc->desc.bNumEndpoints < 1) {
-		dev_err(&interface->dev, "Invalid number of endpoints\n");
-		retval = -EINVAL;
-		goto error;
-	}
-
 	/* set up the endpoint information */
 	for (i = 0; i < iface_desc->desc.bNumEndpoints; ++i) {
 		endpoint = &iface_desc->endpoint[i].desc;
@@ -803,6 +797,13 @@ static int iowarrior_probe(struct usb_in
 			/* this one will match for the IOWarrior56 only */
 			dev->int_out_endpoint = endpoint;
 	}
+
+	if (!dev->int_in_endpoint) {
+		dev_err(&interface->dev, "no interrupt-in endpoint found\n");
+		retval = -ENODEV;
+		goto error;
+	}
+
 	/* we have to check the report_size often, so remember it in the endianness suitable for our machine */
 	dev->report_size = usb_endpoint_maxp(dev->int_in_endpoint);
 	if ((dev->interface->cur_altsetting->desc.bInterfaceNumber == 0) &&


Patches currently in stable-queue which might be from johan@kernel.org are

queue-4.4/usb-serial-digi_acceleport-fix-oob-event-processing.patch
queue-4.4/usb-serial-omninet-fix-reference-leaks-at-open.patch
queue-4.4/usb-serial-digi_acceleport-fix-oob-data-sanity-check.patch
queue-4.4/usb-iowarrior-fix-null-deref-in-write.patch
queue-4.4/usb-iowarrior-fix-null-deref-at-probe.patch
queue-4.4/usb-serial-io_ti-fix-null-deref-in-interrupt-callback.patch
queue-4.4/usb-serial-io_ti-fix-information-leak-in-completion-handler.patch
queue-4.4/usb-serial-safe_serial-fix-information-leak-in-completion-handler.patch

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2017-03-15  7:59 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-03-15  7:58 Patch "USB: iowarrior: fix NULL-deref at probe" has been added to the 4.4-stable tree gregkh

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.