stable.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 01/10] USB: usb_driver_claim_interface: add sanity checking
@ 2016-03-25  2:58 Lu Baolu
  2016-03-25  2:58 ` [PATCH 02/10] USB: cdc-acm: more " Lu Baolu
                   ` (2 more replies)
  0 siblings, 3 replies; 6+ messages in thread
From: Lu Baolu @ 2016-03-25  2:58 UTC (permalink / raw)
  To: baolu.lu; +Cc: Oliver Neukum, stable

From: Oliver Neukum <oneukum@suse.com>

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>
CC: stable@vger.kernel.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
 drivers/usb/core/driver.c | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/drivers/usb/core/driver.c b/drivers/usb/core/driver.c
index 56593a9..2057d91 100644
--- a/drivers/usb/core/driver.c
+++ b/drivers/usb/core/driver.c
@@ -502,11 +502,15 @@ static int usb_unbind_interface(struct device *dev)
 int usb_driver_claim_interface(struct usb_driver *driver,
 				struct usb_interface *iface, void *priv)
 {
-	struct device *dev = &iface->dev;
+	struct device *dev;
 	struct usb_device *udev;
 	int retval = 0;
 	int lpm_disable_error;
 
+	if (!iface)
+		return -ENODEV;
+
+	dev = &iface->dev;
 	if (dev->driver)
 		return -EBUSY;
 
-- 
2.1.4


^ permalink raw reply related	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2016-03-25  3:03 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-03-25  2:58 [PATCH 01/10] USB: usb_driver_claim_interface: add sanity checking Lu Baolu
2016-03-25  2:58 ` [PATCH 02/10] USB: cdc-acm: more " Lu Baolu
2016-03-25  3:03   ` Lu Baolu
2016-03-25  2:58 ` [PATCH 03/10] USB: uas: Reduce can_queue to MAX_CMNDS Lu Baolu
2016-03-25  3:03   ` Lu Baolu
2016-03-25  3:02 ` [PATCH 01/10] USB: usb_driver_claim_interface: add sanity checking Lu Baolu

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).