From: Greg KH <greg@kroah.com>
To: Saranya Gopal <saranya.gopal@intel.com>
Cc: stable@vger.kernel.org, linux-usb@vger.kernel.org,
fei.yang@intel.com, john.stultz@linaro.org,
Felipe Balbi <felipe.balbi@linux.intel.com>
Subject: Re: [PATCH 4.19.y 2/3] usb: dwc3: gadget: prevent dwc3_request from being queued twice
Date: Mon, 29 Jul 2019 18:56:49 +0200 [thread overview]
Message-ID: <20190729165649.GB14160@kroah.com> (raw)
In-Reply-To: <1564407819-10746-3-git-send-email-saranya.gopal@intel.com>
On Mon, Jul 29, 2019 at 07:13:38PM +0530, Saranya Gopal wrote:
> From: Felipe Balbi <felipe.balbi@linux.intel.com>
>
> [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 <felipe.balbi@linux.intel.com>
> Signed-off-by: Saranya Gopal <saranya.gopal@intel.com>
> ---
> 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...
next prev parent reply other threads:[~2019-07-29 16:56 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-07-29 13:43 [PATCH 4.19.y 0/3] usb: dwc3: Prevent requests from being queued twice Saranya Gopal
2019-07-29 13:43 ` [PATCH 4.19.y 1/3] usb: dwc3: gadget: add dwc3_request status tracking Saranya Gopal
2019-07-29 13:43 ` [PATCH 4.19.y 2/3] usb: dwc3: gadget: prevent dwc3_request from being queued twice Saranya Gopal
2019-07-29 16:56 ` Greg KH [this message]
2019-07-29 17:06 ` Gopal, Saranya
2019-07-29 17:28 ` Greg KH
2019-07-29 13:43 ` [PATCH 4.19.y 3/3] usb: dwc3: gadget: remove req->started flag Saranya Gopal
2019-07-29 16:56 ` Greg KH
2019-07-29 16:59 ` Gopal, Saranya
2019-07-29 17:34 ` [PATCH 4.19.y 0/3] usb: dwc3: Prevent requests from being queued twice Greg KH
2019-07-30 9:29 ` Gopal, Saranya
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20190729165649.GB14160@kroah.com \
--to=greg@kroah.com \
--cc=fei.yang@intel.com \
--cc=felipe.balbi@linux.intel.com \
--cc=john.stultz@linaro.org \
--cc=linux-usb@vger.kernel.org \
--cc=saranya.gopal@intel.com \
--cc=stable@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).