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]
Date:   Sun, 14 Mar 2021 04:40:32 +0200
From:   Laurent Pinchart <laurent.pinchart@...asonboard.com>
To:     Pawel Laszczak <pawell@...ence.com>
Cc:     balbi@...nel.org, gregkh@...uxfoundation.org,
        linux-usb@...r.kernel.org, linux-kernel@...r.kernel.org,
        peter.chen@...nel.org, kurahul@...ence.com
Subject: Re: [PATCH v2] usb: gadget: uvc: add bInterval checking for HS mode

Hi Pawel,

Thank you for the patch.

On Mon, Mar 08, 2021 at 01:53:38PM +0100, Pawel Laszczak wrote:
> From: Pawel Laszczak <pawell@...ence.com>
> 
> Patch adds extra checking for bInterval passed by configfs.
> The 5.6.4 chapter of USB Specification (rev. 2.0) say:
> "A high-bandwidth endpoint must specify a period of 1x125 µs
> (i.e., a bInterval value of 1)."
> 
> The issue was observed during testing UVC class on CV.
> I treat this change as improvement because we can control
> bInterval by configfs.
> 
> Signed-off-by: Pawel Laszczak <pawell@...ence.com>

Reviewed-by: Laurent Pinchart <laurent.pinchart@...asonboard.com>

Felipe, could you take this patch in your tree ?

> ---
> Changlog:
> v2:
> - removed duplicated assignment
> 
>  drivers/usb/gadget/function/f_uvc.c | 7 ++++++-
>  1 file changed, 6 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/usb/gadget/function/f_uvc.c b/drivers/usb/gadget/function/f_uvc.c
> index 44b4352a2676..ed77a126a74f 100644
> --- a/drivers/usb/gadget/function/f_uvc.c
> +++ b/drivers/usb/gadget/function/f_uvc.c
> @@ -633,7 +633,12 @@ uvc_function_bind(struct usb_configuration *c, struct usb_function *f)
>  
>  	uvc_hs_streaming_ep.wMaxPacketSize =
>  		cpu_to_le16(max_packet_size | ((max_packet_mult - 1) << 11));
> -	uvc_hs_streaming_ep.bInterval = opts->streaming_interval;
> +
> +	/* A high-bandwidth endpoint must specify a bInterval value of 1 */
> +	if (max_packet_mult > 1)
> +		uvc_hs_streaming_ep.bInterval = 1;
> +	else
> +		uvc_hs_streaming_ep.bInterval = opts->streaming_interval;
>  
>  	uvc_ss_streaming_ep.wMaxPacketSize = cpu_to_le16(max_packet_size);
>  	uvc_ss_streaming_ep.bInterval = opts->streaming_interval;

-- 
Regards,

Laurent Pinchart

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ