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:   Wed, 31 Aug 2016 11:34:26 -0700
From:   Greg <gvrose8192@...il.com>
To:     Eric Dumazet <eric.dumazet@...il.com>
Cc:     netdev@...r.kernel.org, Greg Rose <grose@...htfleet.com>
Subject: Re: [PATCH] net/ethernet: Use ether_addr_copy rather than memcpy

On Wed, 2016-08-31 at 11:32 -0700, Eric Dumazet wrote:
> On Wed, 2016-08-31 at 09:32 -0700, Greg Rose wrote:
> > I'm not sure why this hasn't been done before because it seems obvious,
> > so maybe there is some reason that memcpy is used instead of
> > ether_addr_copy in this code.  But let's try this anyway.
> > 
> > Change memcpy to ether_addr_copy.
> 
> ...
> 
> >  
> > @@ -211,7 +211,7 @@ EXPORT_SYMBOL(eth_type_trans);
> >  int eth_header_parse(const struct sk_buff *skb, unsigned char *haddr)
> >  {
> >  	const struct ethhdr *eth = eth_hdr(skb);
> > -	memcpy(haddr, eth->h_source, ETH_ALEN);
> > +	ether_addr_copy(haddr, eth->h_source);
> 
> 
> Please carefully read ether_addr_copy() comments.
> 
> Not all arches are like x86

Thanks Eric, Joe set me straight already.

- Greg
> 
> 
> 


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ