Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1388266 > unrolled thread

[PATCH 3.2 045/115] USB: usb_driver_claim_interface: add sanity checking

Started byBen Hutchings <ben@decadent.org.uk>
First post2016-04-27 01:30 +0200
Last post2016-04-27 01:30 +0200
Articles 1 — 1 participant

Back to article view | Back to linux.kernel

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

  [PATCH 3.2 045/115] USB: usb_driver_claim_interface: add sanity  checking Ben Hutchings <ben@decadent.org.uk> - 2016-04-27 01:30 +0200

#1388266 — [PATCH 3.2 045/115] USB: usb_driver_claim_interface: add sanity checking

FromBen Hutchings <ben@decadent.org.uk>
Date2016-04-27 01:30 +0200
Subject[PATCH 3.2 045/115] USB: usb_driver_claim_interface: add sanity checking
Message-ID<rskAz-7Vw-55@gated-at.bofh.it>
3.2.80-rc1 review patch.  If anyone has any objections, please let me know.

------------------

From: Oliver Neukum <oneukum@suse.com>

commit 0b818e3956fc1ad976bee791eadcbb3b5fec5bfd upstream.

Attacks that trick drivers into passing a NULL pointer
to usb_driver_claim_interface() using forged descriptors are
known. This thwarts them by sanity checking.

Signed-off-by: Oliver Neukum <ONeukum@suse.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
[bwh: Backported to 3.2: adjust context]
Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
---
 drivers/usb/core/driver.c | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

--- a/drivers/usb/core/driver.c
+++ b/drivers/usb/core/driver.c
@@ -428,9 +428,13 @@ static int usb_unbind_interface(struct d
 int usb_driver_claim_interface(struct usb_driver *driver,
 				struct usb_interface *iface, void *priv)
 {
-	struct device *dev = &iface->dev;
+	struct device *dev;
 	int retval = 0;
 
+	if (!iface)
+		return -ENODEV;
+
+	dev = &iface->dev;
 	if (dev->driver)
 		return -EBUSY;
 

[toc] | [standalone]


Back to top | Article view | linux.kernel


csiph-web