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] [thread-next>] [day] [month] [year] [list]
Date:   Tue, 5 Oct 2021 00:18:45 +0200
From:   Andrew Lunn <andrew@...n.ch>
To:     Jakub Kicinski <kuba@...nel.org>
Cc:     davem@...emloft.net, netdev@...r.kernel.org
Subject: Re: [PATCH net-next 1/2] ethernet: use eth_hw_addr_set() for
 dev->addr_len cases

On Mon, Oct 04, 2021 at 09:05:21AM -0700, Jakub Kicinski wrote:
> Convert all Ethernet drivers from memcpy(... dev->addr_len)
> to eth_hw_addr_set():
> 
>   @@
>   expression dev, np;
>   @@
>   - memcpy(dev->dev_addr, np, dev->addr_len)
>   + eth_hw_addr_set(dev, np)

eth_hw_addr_set() uses ether_addr_copy(), which says:

Please note: dst & src must both be aligned to u16.

memcpy() does not have this restriction. If the source is something
funky, like an EEPROM, it could be oddly aligned.

If you are going to do this, i think the assumption needs removing, a
test added for unaligned addresses and fall back to memcpy().

    Andrew

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ