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-next>] [day] [month] [year] [list]
Date:   Wed, 15 Nov 2017 00:21:21 +0000
From:   Ben Hutchings <ben.hutchings@...ethink.co.uk>
To:     Enrico Mioso <mrkiko.rs@...il.com>,
        Bjørn Mork <bjorn@...k.no>
Cc:     Christian Panton <christian@...ton.org>,
        Christian Panton <christian@...ton.org>,
        linux-usb@...r.kernel.org, netdev@...r.kernel.org,
        Oliver Neukum <oliver@...kum.org>,
        "David S. Miller" <davem@...emloft.net>,
        Porto Rio <porto.rio@....net>,
        Greg Kroah-Hartman <gregkh@...uxfoundation.org>
Subject: Re: [PATCH 4.4 27/56] cdc_ncm: Set NTB format again after
 altsetting switch for Huawei devices

On Tue, 2017-07-11 at 17:21 +0200, Enrico Mioso wrote:
> From: Enrico Mioso <mrkiko.rs@...il.com>
> 
> commit 2b02c20ce0c28974b44e69a2e2f5ddc6a470ad6f upstream.
[...]
> --- a/drivers/net/usb/cdc_ncm.c
> +++ b/drivers/net/usb/cdc_ncm.c
> @@ -724,8 +724,10 @@ int cdc_ncm_bind_common(struct usbnet *d
>  	u8 *buf;
>  	int len;
>  	int temp;
> +	int err;
> 	u8 iface_no;
> 	struct usb_cdc_parsed_header hdr;
> +	u16 curr_ntb_format;
[...]
> +		err = usbnet_read_cmd(dev, USB_CDC_GET_NTB_FORMAT,
> +				      USB_TYPE_CLASS | USB_DIR_IN | USB_RECIP_INTERFACE,
> +				      0, iface_no, &curr_ntb_format, 2);
> +		if (err < 0) {
> +			goto error2;
> +		}
> +
> +		if (curr_ntb_format == USB_CDC_NCM_NTB32_FORMAT) {
[...]

usbnet_read_cmd() doesn't do any byte-swapping, so it looks like
curr_ntb_format will have little-endian byte order (__le16 not u16). 
The comparison will then need to be done using
le16_to_cpu(curr_ntb_format).

Ben.

-- 
Ben Hutchings
Software Developer, Codethink Ltd.

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ