lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <BANLkTimcWN3=qvurDzyMUs8f5+uFPNumaw@mail.gmail.com>
Date:	Fri, 6 May 2011 12:50:33 +0100
From:	Maxin John <maxin.john@...il.com>
To:	Erik Slagter <erik@...gter.name>
Cc:	linux-kernel@...r.kernel.org
Subject: Re: OOPS after connection Droids MuIn USB display

Hi Eric,

> In the file drivers/usb/class/cdc-acm.c, around line 1098, there is a
> comment "/*workaround for switched interfaces */" and then a check:
>
> if (data_interface->cur_altsetting->desc.bInterfaceClass !=
> CDC_DATA_INTERFACE_TYPE)
>
> At this point, the variable data_interface is NULL and this causes the OOPS.
>

I have included some checks for "data_interface" since
"usb_ifnum_to_if" could return NULL.
Could you please check by applying this patch ?

Signed-off-by: Maxin B. John <maxin.john@...il.com>
---
diff --git a/drivers/usb/class/cdc-acm.c b/drivers/usb/class/cdc-acm.c
index e057e53..073f418 100644
--- a/drivers/usb/class/cdc-acm.c
+++ b/drivers/usb/class/cdc-acm.c
@@ -960,6 +960,10 @@ static int acm_probe(struct usb_interface *intf,
        if (quirks == NO_UNION_NORMAL) {
                data_interface = usb_ifnum_to_if(usb_dev, 1);
                control_interface = usb_ifnum_to_if(usb_dev, 0);
+               if (!data_interface || !control_interface) {
+                       dev_dbg(&intf->dev, "no interfaces\n");
+                       return -ENODEV;
+               }
                goto skip_normal_probe;
        }

@@ -1031,6 +1035,10 @@ next_desc:
                if (call_interface_num > 0) {
                        dev_dbg(&intf->dev, "No union descriptor,
using call management descriptor\n");
                        data_interface = usb_ifnum_to_if(usb_dev,
(data_interface_num = call_interface_num));
+                       if (!data_interface) {
+                               dev_dbg(&intf->dev, "no data interface\n");
+                               return -ENODEV;
+                       }
                        control_interface = intf;
                } else {
                        if (intf->cur_altsetting->desc.bNumEndpoints != 3) {
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ