Received: by 2002:a05:6a10:22f:0:0:0:0 with SMTP id 15csp3397743pxk; Mon, 5 Oct 2020 08:41:00 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxYzMKRasI+OOz25BK30UaVJO9mLnfb6RJ2s5YWK21U+saTSjw3c+aABLxslSDJFDmU8627 X-Received: by 2002:a17:906:d9c3:: with SMTP id qk3mr297962ejb.207.1601912460025; Mon, 05 Oct 2020 08:41:00 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1601912460; cv=none; d=google.com; s=arc-20160816; b=Puls+npjuaiEpRkaGj8zlv7BI7Dr7V6MPhww31pgnJmuS9yS15EFHTcpQiFtk7oCm+ 2KMz/9oLftnxqXdX2VwGp22MJV+3C2jnk9XIlY8ZLD0BAJhJjngPxIO4qZI8JRRmbnPM pv+a2JskSUg9yDTrUFUxllwhbU9+4OUJ6v5u1jFLo/xQ01zUOpITYtUYGsQOS8xNXAHJ 3iLh6pu3qimhnt2Z+9u9h1MgrcbWI2eJVTkWItQ4KQ8OdEN+wwp6MuZNvP0LIuUuDBy1 9Ykk+c2WY1mW4X5DPkH/9jX/FDQKou0VvRuC4L9Wg267jz0yeF4HlaxzwY8QWFjktDlw KD1A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=MhcQ1dPJiEHpsAouk58gmf+c0FCtlhKrxtc1aoieNVU=; b=amqAy8r/g40YheHqhD4LZiKGl3Fu3Y4bBx/Q2S3QUlA0RF0krSBsdBW8PyBAw0DgWA A7nfDX0GbEC9dAFkgLNS0PPJV9iXhc4D9ETEOIynogR+WmY6SgpZ06PERuHcwFp+e5A1 hVwKpHBtqv17IM5BiyCC9NIGYJ/f2VGRgHKyYKE+NnCV/NATdJZKZK3AOBR6YVKXHJ8I XauCl8uXP+LIAxwCASiT89ULi6Ou6VSAfg67vkQ9LmFlleT8pePLxgUEA0jt683GB5ZK U+NEq3oO+39rRa3/wkYpa0EShPTMf3hgik0tYruTMW6n5+LUrMWroFnmCGA6p1IJTu6N Ekng== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=E0X7msA+; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id u1si11777edy.369.2020.10.05.08.40.36; Mon, 05 Oct 2020 08:41:00 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=E0X7msA+; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728443AbgJEPg2 (ORCPT + 99 others); Mon, 5 Oct 2020 11:36:28 -0400 Received: from mail.kernel.org ([198.145.29.99]:60276 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728037AbgJEPci (ORCPT ); Mon, 5 Oct 2020 11:32:38 -0400 Received: from localhost (83-86-74-64.cable.dynamic.v4.ziggo.nl [83.86.74.64]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 5C8E9208C7; Mon, 5 Oct 2020 15:32:37 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1601911957; bh=IhUrg3Oki7W6Msi2uepV5D0Ce2I8UgeUV+OVuc8P5AA=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=E0X7msA+BH8AnOZl567wbPRRt1kacHNuOx4+dD3VGLEJ/ii01uQNFgZakaMogrkGp paOz05hbfTE9ehV0orvhJqWoem8SzULCDSUWOOeKVXXRPT0IBDhrQCpePdYLPiyfEu MBtqVqlDGw1+tTRCr4Yp1UADXGU/X9tENekv/zeg= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Bastien Nocera , Valentina Manea , Shuah Khan , Alan Stern , syzkaller@googlegroups.com, Andrey Konovalov , Shuah Khan , "M. Vefa Bicakci" Subject: [PATCH 5.8 05/85] Revert "usbip: Implement a match function to fix usbip" Date: Mon, 5 Oct 2020 17:26:01 +0200 Message-Id: <20201005142115.000911358@linuxfoundation.org> X-Mailer: git-send-email 2.28.0 In-Reply-To: <20201005142114.732094228@linuxfoundation.org> References: <20201005142114.732094228@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: M. Vefa Bicakci commit d6407613c1e2ef90213dee388aa16b6e1bd08cbc upstream. This commit reverts commit 7a2f2974f265 ("usbip: Implement a match function to fix usbip"). In summary, commit d5643d2249b2 ("USB: Fix device driver race") inadvertently broke usbip functionality, which I resolved in an incorrect manner by introducing a match function to usbip, usbip_match(), that unconditionally returns true. However, the usbip_match function, as is, causes usbip to take over virtual devices used by syzkaller for USB fuzzing, which is a regression reported by Andrey Konovalov. Furthermore, in conjunction with the fix of another bug, handled by another patch titled "usbcore/driver: Fix specific driver selection" in this patch set, the usbip_match function causes unexpected USB subsystem behaviour when the usbip_host driver is loaded. The unexpected behaviour can be qualified as follows: - If commit 41160802ab8e ("USB: Simplify USB ID table match") is included in the kernel, then all USB devices are bound to the usbip_host driver, which appears to the user as if all USB devices were disconnected. - If the same commit (41160802ab8e) is not in the kernel (as is the case with v5.8.10) then all USB devices are re-probed and re-bound to their original device drivers, which appears to the user as a disconnection and re-connection of USB devices. Please note that this commit will make usbip non-operational again, until yet another patch in this patch set is merged, titled "usbcore/driver: Accommodate usbip". Cc: # 5.8: 41160802ab8e: USB: Simplify USB ID table match Cc: # 5.8 Cc: Bastien Nocera Cc: Valentina Manea Cc: Shuah Khan Cc: Greg Kroah-Hartman Cc: Alan Stern Cc: Reported-by: Andrey Konovalov Tested-by: Andrey Konovalov Acked-by: Shuah Khan Signed-off-by: M. Vefa Bicakci Link: https://lore.kernel.org/r/20200922110703.720960-2-m.v.b@runbox.com Signed-off-by: Greg Kroah-Hartman --- drivers/usb/usbip/stub_dev.c | 6 ------ 1 file changed, 6 deletions(-) --- a/drivers/usb/usbip/stub_dev.c +++ b/drivers/usb/usbip/stub_dev.c @@ -461,11 +461,6 @@ static void stub_disconnect(struct usb_d return; } -static bool usbip_match(struct usb_device *udev) -{ - return true; -} - #ifdef CONFIG_PM /* These functions need usb_port_suspend and usb_port_resume, @@ -491,7 +486,6 @@ struct usb_device_driver stub_driver = { .name = "usbip-host", .probe = stub_probe, .disconnect = stub_disconnect, - .match = usbip_match, #ifdef CONFIG_PM .suspend = stub_suspend, .resume = stub_resume,