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: <2AC7D4AD8BA1C640B4C60C61C8E520153E3DEF6B0D@EXDCVYMBSTM006.EQ1STM.local>
Date:	Wed, 3 Aug 2011 13:13:08 +0200
From:	Alexey ORISHKO <alexey.orishko@...ricsson.com>
To:	David Miller <davem@...emloft.net>
Cc:	"netdev@...r.kernel.org" <netdev@...r.kernel.org>,
	"oliver@...kum.org" <oliver@...kum.org>,
	"linux-usb@...r.kernel.org" <linux-usb@...r.kernel.org>,
	"gregkh@...e.de" <gregkh@...e.de>,
	"alexey.orishko@...il.com" <alexey.orishko@...il.com>
Subject: RE: [PATCH ] cdc_ncm: fixes for big-endian architecture / MIPS

> -----Original Message-----
> From: David Miller [mailto:davem@...emloft.net]
> Sent: Wednesday, August 03, 2011 12:43 PM
> To: alexey.orishko@...il.com
> Cc: netdev@...r.kernel.org; oliver@...kum.org; linux-usb@...r.kernel.org;
> gregkh@...e.de; Alexey ORISHKO
> Subject: Re: [PATCH ] cdc_ncm: fixes for big-endian architecture / MIPS
> 
> From: Alexey Orishko <alexey.orishko@...il.com>
> Date: Tue,  2 Aug 2011 18:20:26 +0200
> 
> > @@ -203,8 +203,8 @@ static u8 cdc_ncm_setup(struct cdc_ncm_ctx *ctx)
> >  	req.bmRequestType = USB_TYPE_CLASS | USB_DIR_IN | USB_RECIP_INTERFACE;
> >  	req.bNotificationType = USB_CDC_GET_NTB_PARAMETERS;
> >  	req.wValue = 0;
> > -	req.wIndex = cpu_to_le16(iface_no);
> > -	req.wLength = cpu_to_le16(sizeof(ctx->ncm_parm));
> > +	req.wIndex = iface_no;
> > +	req.wLength = sizeof(ctx->ncm_parm);
> >
> >  	err = cdc_ncm_do_request(ctx, &req, &ctx->ncm_parm, 0, NULL, 1000);
> >  	if (err) {
> 
> This can't be correct.
> 
> "iface_no" is a u8 we read out of desc->bInterfaceNumber
> 
> we still have to extend it to a u16 and convert it to a little endian
> 16-bit value for the req.wIndex field.
> 
> If the types for the cdc notification struct are wrong, that's another
> story entirely.  But currently they are marked as __le16 so you must
> resolve this first.

Ok. I see where confusion started...
cdc_ncm is incorrectly using struct usb_cdc_notification (__le16) as input
to usb_control_msg() function, which is expecting u16 data type arguments.

I will post an updated patch shortly.

alexey
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ