linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] option: Do not try to bind to ADB interfaces
@ 2018-07-23 14:02 Romain Izard
  2018-07-23 14:08 ` Greg Kroah-Hartman
  2018-07-23 15:15 ` Lars Melin
  0 siblings, 2 replies; 8+ messages in thread
From: Romain Izard @ 2018-07-23 14:02 UTC (permalink / raw)
  To: Johan Hovold, Greg Kroah-Hartman
  Cc: linux-usb, linux-kernel, Romain Izard, stable

Some modems now use the Android Debug Bridge to provide a debugging
interface, and some phones can also export serial ports managed by the
"option" driver.

The ADB daemon running in userspace tries to use USB interfaces with
bDeviceClass=0xFF, bDeviceSubClass=0x42, bDeviceProtocol=1

Prevent the option driver from binding to those interfaces, as they
will not be serial ports.

This can fix issues like:
https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=781256

Signed-off-by: Romain Izard <romain.izard.pro@gmail.com>
Cc: stable <stable@vger.kernel.org>
---
 drivers/usb/serial/option.c | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/drivers/usb/serial/option.c b/drivers/usb/serial/option.c
index 664e61f16b6a..f98943a57ff0 100644
--- a/drivers/usb/serial/option.c
+++ b/drivers/usb/serial/option.c
@@ -1987,6 +1987,12 @@ static int option_probe(struct usb_serial *serial,
 	if (iface_desc->bInterfaceClass == USB_CLASS_MASS_STORAGE)
 		return -ENODEV;
 
+	/* Do not bind Android Debug Bridge interfaces */
+	if (iface_desc->bInterfaceClass == USB_CLASS_VENDOR_SPEC &&
+		iface_desc->bInterfaceSubClass == 0x42 &&
+		iface_desc->bInterfaceProtocol == 1)
+		return -ENODEV;
+
 	/*
 	 * Don't bind reserved interfaces (like network ones) which often have
 	 * the same class/subclass/protocol as the serial interfaces.  Look at
-- 
2.17.1


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

end of thread, other threads:[~2018-08-29  7:56 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-07-23 14:02 [PATCH] option: Do not try to bind to ADB interfaces Romain Izard
2018-07-23 14:08 ` Greg Kroah-Hartman
2018-07-23 16:45   ` Romain Izard
2018-08-27 13:28     ` Johan Hovold
2018-08-27 16:15       ` Bjørn Mork
2018-08-29  7:56         ` Johan Hovold
2018-07-23 15:15 ` Lars Melin
2018-07-23 16:37   ` Romain Izard

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