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=-8.3 required=3.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI, 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 998AAC7618B for ; Mon, 29 Jul 2019 17:28:25 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 72026206DD for ; Mon, 29 Jul 2019 17:28:25 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=kroah.com header.i=@kroah.com header.b="nfnMvHsS"; dkim=pass (2048-bit key) header.d=messagingengine.com header.i=@messagingengine.com header.b="f9sSuLSi" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728907AbfG2R2Y (ORCPT ); Mon, 29 Jul 2019 13:28:24 -0400 Received: from out1-smtp.messagingengine.com ([66.111.4.25]:33301 "EHLO out1-smtp.messagingengine.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725934AbfG2R2Y (ORCPT ); Mon, 29 Jul 2019 13:28:24 -0400 Received: from compute6.internal (compute6.nyi.internal [10.202.2.46]) by mailout.nyi.internal (Postfix) with ESMTP id 7303920F5C; Mon, 29 Jul 2019 13:28:23 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute6.internal (MEProxy); Mon, 29 Jul 2019 13:28:23 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kroah.com; h= date:from:to:cc:subject:message-id:references:mime-version :content-type:in-reply-to; s=fm1; bh=BfT1kwVnDm8QQXSpmi6sJhypCO6 Y4+Cf2C8ekSA850w=; b=nfnMvHsSfLKIExdotuYg8jcoNsfAiqLd9IlVPF0SOJp juwF7KOfhB8+NqZ615gzjZ1yZnRdwdn0/Uc81klXIQwWNRqauGNU4H090fTXqtme 1ZO7L/76RXxTo9eGzXm8NqZSpPJhzxPZIBtCUnoJ83OqOJgm15XFs2S8Q83i7hYs qGZpZ6sXzEUIbU7MVFQqPzWzJkl+p+49vbFI7mTJnfYrlC2BJlIdQ+JAF8lX/8pI 1PIplgOE/8jxXTWm7I2cAiMNnYqh11EYgiZPpeIxu2MwAE0v0T6A1WQ+s3LOO7fn qEnAaW6nPkx1z7jbCPTBCjaNOZroQMvWTrJvzJ+zlfA== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to:x-me-proxy :x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s=fm3; bh=BfT1kw VnDm8QQXSpmi6sJhypCO6Y4+Cf2C8ekSA850w=; b=f9sSuLSiOw9wxasIxsZj8e 2YQjMUMnei7p0E3PuoCKEITU2LM0iMVg06LjrSdA815voKAC25Yq+LlJMKaDK/ts AHSx7SdWfLbbyG60XIkI72Cqp4DxE86jnTGwv91+nWh8FsaflqlKMrZ3qkEqPBhN 2J9YUbR093vXXRe7fVYoIRGE+hn+bIo5Wd2vt4vAL7APoxIN7HVPnmg+0rAdyQd7 Au3Su6KiiaNbIWPhWzwMTEzTotx2qE+10v+r71LDjqAzeCon2XtDvTAZc7Re1qqf kOhLKjBgpBOEbRyCMv9AyCvTf2w0AlGCK/5c5SNTUhWE6cCne7lkt27388nmIH4Q == X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeduvddrledugdduudefucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhepfffhvffukfhfgggtuggjfgesthdtredttdervdenucfhrhhomhepifhrvghg ucfmjfcuoehgrhgvgheskhhrohgrhhdrtghomheqnecukfhppeekfedrkeeirdekledrud dtjeenucfrrghrrghmpehmrghilhhfrhhomhepghhrvghgsehkrhhorghhrdgtohhmnecu vehluhhsthgvrhfuihiivgeptd X-ME-Proxy: Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) by mail.messagingengine.com (Postfix) with ESMTPA id 42E1380059; Mon, 29 Jul 2019 13:28:22 -0400 (EDT) Date: Mon, 29 Jul 2019 19:28:20 +0200 From: Greg KH To: "Gopal, Saranya" Cc: "stable@vger.kernel.org" , "linux-usb@vger.kernel.org" , "Yang, Fei" , "john.stultz@linaro.org" , Felipe Balbi Subject: Re: [PATCH 4.19.y 2/3] usb: dwc3: gadget: prevent dwc3_request from being queued twice Message-ID: <20190729172820.GA17093@kroah.com> References: <1564407819-10746-1-git-send-email-saranya.gopal@intel.com> <1564407819-10746-3-git-send-email-saranya.gopal@intel.com> <20190729165649.GB14160@kroah.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.12.1 (2019-06-15) Sender: linux-usb-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-usb@vger.kernel.org On Mon, Jul 29, 2019 at 05:06:13PM +0000, Gopal, Saranya wrote: > > On Mon, Jul 29, 2019 at 07:13:38PM +0530, Saranya Gopal wrote: > > > From: Felipe Balbi > > > > > > [Upstream commit b2b6d601365a1acb90b87c85197d79] > > > > > > Queueing the same request twice can introduce hard-to-debug > > > problems. At least one function driver - Android's f_mtp.c - is known > > > to cause this problem. > > > > > > While that function is out-of-tree, this is a problem that's easy > > > enough to avoid. > > > > > > Signed-off-by: Felipe Balbi > > > Signed-off-by: Saranya Gopal > > > --- > > > drivers/usb/dwc3/gadget.c | 5 +++++ > > > 1 file changed, 5 insertions(+) > > > > > > diff --git a/drivers/usb/dwc3/gadget.c b/drivers/usb/dwc3/gadget.c > > > index 3f337a0..a56a92a 100644 > > > --- a/drivers/usb/dwc3/gadget.c > > > +++ b/drivers/usb/dwc3/gadget.c > > > @@ -1291,6 +1291,11 @@ static int __dwc3_gadget_ep_queue(struct > > dwc3_ep *dep, struct dwc3_request *req) > > > &req->request, req->dep->name)) > > > return -EINVAL; > > > > > > + if (WARN(req->status < DWC3_REQUEST_STATUS_COMPLETED, > > > + "%s: request %pK already in flight\n", > > > + dep->name, &req->request)) > > > + return -EINVAL; > > > > So we are going to trip syzbot up on this out-of-tree driver? Brave... > > I had retained the commit message from the upstream commit. > However, without this patch, I see issues with adb as well. > Adb will hang after adb root/unroot command and needs a reboot to recover. So you see huge WARN dumps in the log? That's fine, but be aware, if userspace can trigger this, then syzbot will trigger it, and any system running 'panic on warn' will crash. If this is something that we normally have to catch and handle, WARN() is not how to do it. But we should fix that upstream, not here. thanks, greg k-h