From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-12.8 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH,MAILING_LIST_MULTI,NICE_REPLY_A,SIGNED_OFF_BY,SPF_HELO_NONE, SPF_PASS,URIBL_BLOCKED,USER_AGENT_SANE_1 autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 07D5EC4727D for ; Tue, 22 Sep 2020 23:03:20 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id B5273221EB for ; Tue, 22 Sep 2020 23:03:19 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1600815799; bh=AhhvCdTx3489HlqfHiVnR+twluKu0CPeJUTs1ctBZlM=; h=Subject:To:Cc:References:From:Date:In-Reply-To:List-ID:From; b=Lcd6dMOzBUY0BLoXlmrvt47fXnhcSwASG01UKKMPvg9KAs2U0Eh2njwuuumAmO1RU uNKGq88FZA/2sHj5eYrHvO44ynPQRzt8yqR4YNJyn3/mODFGoonOhmv68f3MLHxIYO hZnFNznXoom7TGY05YejMblrTugTyNjydZORRtXo= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726654AbgIVXDS (ORCPT ); Tue, 22 Sep 2020 19:03:18 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60340 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726448AbgIVXDS (ORCPT ); Tue, 22 Sep 2020 19:03:18 -0400 Received: from mail-oi1-x243.google.com (mail-oi1-x243.google.com [IPv6:2607:f8b0:4864:20::243]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 81562C061755 for ; Tue, 22 Sep 2020 16:03:18 -0700 (PDT) Received: by mail-oi1-x243.google.com with SMTP id m7so22935529oie.0 for ; Tue, 22 Sep 2020 16:03:18 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxfoundation.org; s=google; h=subject:to:cc:references:from:message-id:date:user-agent :mime-version:in-reply-to:content-language:content-transfer-encoding; bh=j7SkZDfC2KmUJU0iZY35f0jqKt3MsVACF2CocO4OH+Y=; b=LG0cqv5G917FUuXaPKLLH3lMM9K2B21Io9jX7P0YwznHNftVVt+DNwADL+kWrCHqTt y730Lsdc8UNPGy1Ra65kxTonNEeQli51B3RJmmnkY1h7Gx+7RmhWgCI4VcALp3YBJC7W 1XMSJDcrGiGD1TrJHVo/ogSdC4qp4oBeocPIQ= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=j7SkZDfC2KmUJU0iZY35f0jqKt3MsVACF2CocO4OH+Y=; b=OarwuOyw1CD61AarqFsElhI2VzX/1NqqH0cLzSoLBLaF/MS4cjED7wOKWGg289OdTN ej/3FoL/T8eWFuB8IcWQ0AXQJ91CpgPijCHYARdIHp8LYi83Wy+8NVtAGS55bo65obZK 4pJrxLXKcX3WFYP4nNFDTNODYYyS+hqgoQ7t5+pb2BrUPKCvUluKbX3iCjj3xPu7j+0v Fjxm4YIdhDTx0nhKT5dUkLmg2D8xMVsuVMyEFNAajmtpYLCrMOe4eeru/7vM1E0nXswM cm0nFmaRT1owbRiDAodXLkdJZJWCPuEqBElLbUJp5hBQtnSclJrnAP16Hr7xPO7Kv+nx /2OQ== X-Gm-Message-State: AOAM531+bKYBs3LamjLp9/RnL9xZoKKjHgTQLHyXoLcW1sJX+mKECq4H UHW4dTrnAWP7OalrNARbjPYd/A== X-Google-Smtp-Source: ABdhPJxSQWfEh5NxtWq0suCxJI4s7oxPr1qqJkjYtNThV5ywEhpVxXaOjibP7aUW9tQm7ShuZ7o3gA== X-Received: by 2002:aca:4a4d:: with SMTP id x74mr3820223oia.6.1600815797731; Tue, 22 Sep 2020 16:03:17 -0700 (PDT) Received: from [192.168.1.112] (c-24-9-64-241.hsd1.co.comcast.net. [24.9.64.241]) by smtp.gmail.com with ESMTPSA id x21sm7833048oie.49.2020.09.22.16.03.16 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 22 Sep 2020 16:03:17 -0700 (PDT) Subject: Re: [PATCH v3 1/4] Revert "usbip: Implement a match function to fix usbip" To: "M. Vefa Bicakci" , linux-usb@vger.kernel.org Cc: stable@vger.kernel.org, Bastien Nocera , Valentina Manea , Shuah Khan , Greg Kroah-Hartman , Alan Stern , syzkaller@googlegroups.com, Shuah Khan References: <20200922110703.720960-1-m.v.b@runbox.com> <20200922110703.720960-2-m.v.b@runbox.com> From: Shuah Khan Message-ID: Date: Tue, 22 Sep 2020 17:03:15 -0600 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.10.0 MIME-Version: 1.0 In-Reply-To: <20200922110703.720960-2-m.v.b@runbox.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-usb@vger.kernel.org On 9/22/20 5:07 AM, M. Vefa Bicakci wrote: > 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". > > Reported-by: Andrey Konovalov > Link: https://lore.kernel.org/linux-usb/CAAeHK+zOrHnxjRFs=OE8T=O9208B9HP_oo8RZpyVOZ9AJ54pAA@mail.gmail.com/ > 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: > Signed-off-by: M. Vefa Bicakci > > --- > v3: New patch in the patch set. > > Note for stable tree maintainers: I have marked the following commit > as a dependency of this patch, because that commit resolves a bug that > the next commit in this patch set uncovers, where if a driver does > not have an id_table, then its match function is not considered for > execution at all. > commit 41160802ab8e ("USB: Simplify USB ID table match") > --- > drivers/usb/usbip/stub_dev.c | 6 ------ > 1 file changed, 6 deletions(-) > > diff --git a/drivers/usb/usbip/stub_dev.c b/drivers/usb/usbip/stub_dev.c > index 9d7d642022d1..2305d425e6c9 100644 > --- a/drivers/usb/usbip/stub_dev.c > +++ b/drivers/usb/usbip/stub_dev.c > @@ -461,11 +461,6 @@ static void stub_disconnect(struct usb_device *udev) > 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, > Thank you for finding a solution that works for usbip Acked-by: Shuah Khan thanks, -- Shuah