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: <9235D6609DB808459E95D78E17F2E43D537333@CHN-SV-EXMX02.mchp-main.com>
Date:	Wed, 29 Jul 2015 21:57:52 +0000
From:	<Woojung.Huh@...rochip.com>
To:	<davem@...emloft.net>
CC:	<netdev@...r.kernel.org>
Subject: RE: [PATCH net-next 1/1] Microchip's LAN7800 family USB 2/3 to
 10/100/1000 Ethernet device driver

Thanks for review and comment.
Will repost  after update.

> -----Original Message-----
> From: David Miller [mailto:davem@...emloft.net]
> Sent: Wednesday, July 29, 2015 3:14 PM
> To: Woojung Huh - C21699
> Cc: netdev@...r.kernel.org
> Subject: Re: [PATCH net-next 1/1] Microchip's LAN7800 family USB 2/3 to
> 10/100/1000 Ethernet device driver
> 
> From: <Woojung.Huh@...rochip.com>
> Date: Mon, 27 Jul 2015 19:59:30 +0000
> 
> > +static int lan78xx_read_stats(struct lan78xx_net *dev,
> > +			      struct lan78xx_statstage *data)
> > +{
> > +	int ret = 0;
> > +	struct lan78xx_statstage *stats;
> > +
> > +	BUG_ON(!dev);
> > +	BUG_ON(!data);
> > +	BUG_ON(sizeof(struct lan78xx_statstage) != 0xBC);
> > +
> > +	stats = kmalloc(sizeof(*stats), GFP_KERNEL);
> > +	if (!stats)
> > +		return -ENOMEM;
> > +
> > +	ret = usb_control_msg(dev->udev,
> > +			      usb_rcvctrlpipe(dev->udev, 0),
> > +			      USB_VENDOR_REQUEST_GET_STATS,
> > +			      USB_DIR_IN | USB_TYPE_VENDOR |
> USB_RECIP_DEVICE,
> > +			      0,
> > +			      0,
> > +			      (void *)stats,
> > +			      sizeof(*stats),
> > +			      USB_CTRL_SET_TIMEOUT);
> > +	if (likely(ret >= 0)) {
> > +		le32_to_cpus(stats);
> > +		*data = *stats;
> 
> This doesn't work.
> 
> le32_to_cpus() will only byte swap the first 'u32' in this statistics structure,
> not all of them.
> 
> You have to explicitly byte swap each and every member.
--
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