Received: by 2002:ac0:a5a7:0:0:0:0:0 with SMTP id m36-v6csp5850419imm; Mon, 23 Jul 2018 07:09:46 -0700 (PDT) X-Google-Smtp-Source: AAOMgpdkiaLpL6kLMsnu6Ud1KQwYp58LsvkOOVvdBXBjPg5kq6PQAjPA4elgy3jYp7dip2UFLnGh X-Received: by 2002:a65:6086:: with SMTP id t6-v6mr12596379pgu.424.1532354986578; Mon, 23 Jul 2018 07:09:46 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1532354986; cv=none; d=google.com; s=arc-20160816; b=pzCTVvhLOJf1+nP1mTf2XD9feUq9Gpb4pJXpMJ4eEQ3tsMTs1yC+8/7xEJ8I7mwOT1 2xsMFJJBazP4BXna5NKwC18T+5Gk8TL2rPleRL5FW+eWKm80jDHuSHTwNE2oV00hS3Wi GilnOmz0toTFqFGG71WvD5Lq+vL2q94tJHu2JctBgceY4dUGbju0Wsqo8uPh2KcdMO5w SpFkqDs0qnSr8sZwwskj4/yUzL8AyvOJJdiapN0UiOYsXqrxIBgHg2bJPjBqJcfyziaS BCI+PwusdSUZpYv6S/Uatfd87TYHgfzFdu6Rgxk2/rTlET0+/zrQWZJ0ycEbBXrevDUd xRkw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:arc-authentication-results; bh=clCL3CtdLlLvzQ329EYCWFfTnvPhwbl7zmJPSZN3DiI=; b=q9NauuOivuNc1+87IGgixdTG2amo1cV83um9OSeRmhNQNF+cJK0faoc6pqUBam5MU4 cNOBNgkswR54h1XNN+/AQMjfGDVFHyXf08011kUwYx8J8qXWlKJ60R7iyzmCCeyalWpg 1d4NQm9oO5Zbd77Lpbx6vIq3FhL5ViXFg9LpgbCB9B3u2XIjEZ1eIguO5UzgPycQcPrR wBjZcz+VpvK9J2luajEDFFBBYjpxPtPmhmbDMEvjoBkD10Y822h9X5hVmiCP5Y1qo6Dp R48znfEQfYJcB+/WozYijzzdvK1ReI4r/MuQMNq4Xav9vU+H3df0h7rWfkAnjun8waGw n5Lw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id n3-v6si7937252pgk.43.2018.07.23.07.09.31; Mon, 23 Jul 2018 07:09:46 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2388204AbeGWPJ3 (ORCPT + 99 others); Mon, 23 Jul 2018 11:09:29 -0400 Received: from mail.linuxfoundation.org ([140.211.169.12]:59182 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2387999AbeGWPJ3 (ORCPT ); Mon, 23 Jul 2018 11:09:29 -0400 Received: from localhost (LFbn-1-12238-233.w90-92.abo.wanadoo.fr [90.92.53.233]) by mail.linuxfoundation.org (Postfix) with ESMTPSA id BAAF841C; Mon, 23 Jul 2018 14:08:03 +0000 (UTC) Date: Mon, 23 Jul 2018 16:08:01 +0200 From: Greg Kroah-Hartman To: Romain Izard Cc: Johan Hovold , linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org, stable Subject: Re: [PATCH] option: Do not try to bind to ADB interfaces Message-ID: <20180723140801.GA4835@kroah.com> References: <20180723140220.7166-1-romain.izard.pro@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20180723140220.7166-1-romain.izard.pro@gmail.com> User-Agent: Mutt/1.10.1 (2018-07-13) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Jul 23, 2018 at 04:02:20PM +0200, Romain Izard wrote: > 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 > Cc: stable > --- > 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; Shouldn't you also check the vendor/product id as well? Otherwise this has the potential to match random devices that are not really adb devices. thanks, greg k-h