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: <1230155827.1447.10.camel@brick>
Date:	Wed, 24 Dec 2008 13:57:07 -0800
From:	Harvey Harrison <harvey.harrison@...il.com>
To:	Christoph Hellwig <hch@...radead.org>
Cc:	Ben Hutchings <bhutchings@...arflare.com>,
	Ron Mercer <ron.mercer@...gic.com>, netdev@...r.kernel.org
Subject: Re: [PATCH 3/5] qlge: bugfix: Fix endian issue regarding shadow
 registers.

On Wed, 2008-12-24 at 16:15 -0500, Christoph Hellwig wrote:
> On Wed, Dec 24, 2008 at 06:35:31PM +0000, Ben Hutchings wrote:
> > > -static inline unsigned int ql_read_sh_reg(const volatile void  *addr)
> > > +static inline u32 ql_read_sh_reg(const volatile void  *addr)
> > >  {
> > > -	return *(volatile unsigned int __force *)addr;
> > > +	return le32_to_cpu(*(volatile unsigned int __force *)addr);
> > 
> > I think that should be:
> > 	???return le32_to_cpu(*(const volatile __le32 *)addr);
> 
> No.  It needs more love than that.
> 
> ql_read_sh_reg is only used to access .prod_idx_sh_reg in the rx_ring
> structure, which is an offset from the .rx_ring_shadow_reg_area member.
> So instead of all this werid casting .prod_idx_sh_reg should simply
> be a __le32 pointer, whithout volatile and the other mess, and then
> you can use le32_to_cpu directly and kill the helper.
> 
> And please verify the whole driver for endianess issues using sparse
> while you're at it...

I've already deleted the patches from my inbox, but if you send them
again off-list I'll have a look as well.

Harvey

--
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