Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1375923
| From | Jiri Slaby <jslaby@suse.cz> |
|---|---|
| Newsgroups | linux.kernel |
| Subject | [PATCH 3.12 49/98] USB: usb_driver_claim_interface: add sanity checking |
| Date | 2016-04-11 15:50 +0200 |
| Message-ID | <rmKo3-6L0-61@gated-at.bofh.it> (permalink) |
| References | <rmK4G-6zt-5@gated-at.bofh.it> |
| Organization | linux.* mail to news gateway |
From: Oliver Neukum <oneukum@suse.com>
3.12-stable review patch. If anyone has any objections, please let me know.
===============
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: Jiri Slaby <jslaby@suse.cz>
---
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 bfddeb3bc97e..8053fab9ae69 100644
--- a/drivers/usb/core/driver.c
+++ b/drivers/usb/core/driver.c
@@ -463,11 +463,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.8.1
Back to linux.kernel | Previous | Next | Find similar | Unroll thread
[PATCH 3.12 49/98] USB: usb_driver_claim_interface: add sanity checking Jiri Slaby <jslaby@suse.cz> - 2016-04-11 15:50 +0200
csiph-web