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: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <20240906080632.GA389470@nchen-desktop>
Date: Fri, 6 Sep 2024 16:06:32 +0800
From: Peter Chen <peter.chen@...nel.org>
To: Pawel Laszczak <pawell@...ence.com>
Cc: "gregkh@...uxfoundation.org" <gregkh@...uxfoundation.org>,
	"linux-usb@...r.kernel.org" <linux-usb@...r.kernel.org>,
	"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
	"stable@...r.kernel.org" <stable@...r.kernel.org>
Subject: Re: [PATCH v2] usb: cdnsp: Fix incorrect usb_request status

On 24-09-06 06:48:54, Pawel Laszczak wrote:
> Fix changes incorrect usb_request->status returned during disabling
> endpoints. Before fix the status returned during dequeuing requests
> while disabling endpoint was ECONNRESET.
> Patch change it to ESHUTDOWN.
> 
> Patch fixes issue detected during testing UVC gadget.
> During stopping streaming the class starts dequeuing usb requests and
> controller driver returns the -ECONNRESET status. After completion
> requests the class or application "uvc-gadget" try to queue this
> request again. Changing this status to ESHUTDOWN cause that UVC assumes
> that endpoint is disabled, or device is disconnected and stops
> re-queuing usb requests.
> 
> Fixes: 3d82904559f4 ("usb: cdnsp: cdns3 Add main part of Cadence USBSSP DRD Driver")
> cc: stable@...r.kernel.org
> Signed-off-by: Pawel Laszczak <pawell@...ence.com>

Reviewed-by: Peter Chen <peter.chen@...nel.org>

Peter
> 
> ---
> Changelog:
> v2:
> - added explanation of issue
> 
>  drivers/usb/cdns3/cdnsp-ring.c | 6 ++++--
>  1 file changed, 4 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/usb/cdns3/cdnsp-ring.c b/drivers/usb/cdns3/cdnsp-ring.c
> index 1e011560e3ae..bccc8fc143d0 100644
> --- a/drivers/usb/cdns3/cdnsp-ring.c
> +++ b/drivers/usb/cdns3/cdnsp-ring.c
> @@ -718,7 +718,8 @@ int cdnsp_remove_request(struct cdnsp_device *pdev,
>  	seg = cdnsp_trb_in_td(pdev, cur_td->start_seg, cur_td->first_trb,
>  			      cur_td->last_trb, hw_deq);
>  
> -	if (seg && (pep->ep_state & EP_ENABLED))
> +	if (seg && (pep->ep_state & EP_ENABLED) &&
> +	    !(pep->ep_state & EP_DIS_IN_RROGRESS))
>  		cdnsp_find_new_dequeue_state(pdev, pep, preq->request.stream_id,
>  					     cur_td, &deq_state);
>  	else
> @@ -736,7 +737,8 @@ int cdnsp_remove_request(struct cdnsp_device *pdev,
>  	 * During disconnecting all endpoint will be disabled so we don't
>  	 * have to worry about updating dequeue pointer.
>  	 */
> -	if (pdev->cdnsp_state & CDNSP_STATE_DISCONNECT_PENDING) {
> +	if (pdev->cdnsp_state & CDNSP_STATE_DISCONNECT_PENDING ||
> +	    pep->ep_state & EP_DIS_IN_RROGRESS) {
>  		status = -ESHUTDOWN;
>  		ret = cdnsp_cmd_set_deq(pdev, pep, &deq_state);
>  	}
> -- 
> 2.43.0
> 

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ