lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <Pine.LNX.4.44L0.1702271706400.6449-100000@netrider.rowland.org>
Date:   Mon, 27 Feb 2017 17:11:35 -0500 (EST)
From:   Alan Stern <stern@...land.harvard.edu>
To:     Baolin Wang <baolin.wang@...aro.org>
cc:     Felipe Balbi <balbi@...nel.org>,
        Greg KH <gregkh@...uxfoundation.org>,
        USB <linux-usb@...r.kernel.org>,
        LKML <linux-kernel@...r.kernel.org>,
        Linaro Kernel Mailman List <linaro-kernel@...ts.linaro.org>,
        Mark Brown <broonie@...nel.org>
Subject: Re: [PATCH] usb: dwc3: ep0: Fix the possible missed request for
 handling delay STATUS phase

On Tue, 21 Feb 2017, Baolin Wang wrote:

> On 17 February 2017 at 16:04, Felipe Balbi <balbi@...nel.org> wrote:
> >
> > Hi,
> >
> > Baolin Wang <baolin.wang@...aro.org> writes:
> >>>> (One possible approach would be to have the setup routine return
> >>>> different values for explicit and implicit status stages -- for
> >>>> example, return 1 if it wants to submit an explicit status request.
> >>>> That wouldn't be very different from the current
> >>>> USB_GADGET_DELAYED_STATUS approach.)
> >>>
> >>> not really, no. The idea was for composite.c and/or functions to support
> >>> both methods (temporarily) and use "gadget->wants_explicit_stages" to
> >>> explicitly queue DATA and STATUS. That would mean that f_mass_storage
> >>> wouldn't have to return DELAYED_STATUS if
> >>> (gadget->wants_explicit_stages).
> >>>
> >>> After all UDCs are converted over and set wants_explicit_stages (which
> >>> should all be done in a single series), then we get rid of the flag and
> >>> the older method of DELAYED_STATUS.
> >>
> >> (Sorry for late reply due to my holiday)
> >> I also met the problem pointed by Alan, from my test, I still want to
> >> need one return value to indicate if it wants to submit an explicit
> >> status request. Think about the Control-IN with a data stage, we can
> >> not get the STATUS phase request from usb_ep_queue() call, and we need
> >
> > why not? wLength tells you that this is a 3-stage transfer. Gadget
> > driver should be able to figure out that it needs to usb_ep_queue()
> > another request for status stage.
> 
> I tried again, but still can not work. Suppose the no-data control:
> (1) SET_ADDRESS request: function driver will not queue one request
> for status phase by usb_ep_queue() call.

Function drivers do not handle Set-Address requests at all.  The UDC
driver handles these requests without telling the gadget driver about 
them.

> (2) SET_CONFIGURATION request: function driver will queue one 0-length
> request for status phase by usb_ep_queue() call, especially for
> mass_storage driver, it will queue one request  for status phase
> later.
> 
> So I am not sure how the Gadget driver can figure out that it needs to
> usb_ep_queue() another request for status stage when handling the
> no-data control?

Gadget drivers already queue status-stage requests for no-data
control-OUT requests.  The difficulty comes when you want to handle an
IN request or an OUT request with a data stage.

Alan Stern

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ