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 PHC | |
Open Source and information security mailing list archives
| ||
|
Date: Thu, 13 Jan 2022 20:21:37 -0800 From: Jakub Kicinski <kuba@...nel.org> To: Michael Ellerman <mpe@...erman.id.au> Cc: <netdev@...r.kernel.org>, <davem@...emloft.net>, <linuxppc-dev@...ts.ozlabs.org> Subject: Re: [PATCH] net: apple: mace: Fix build since dev_addr constification On Fri, 14 Jan 2022 14:12:52 +1100 Michael Ellerman wrote: > Since commit adeef3e32146 ("net: constify netdev->dev_addr") the mace > driver no longer builds with various errors (pmac32_defconfig): > > linux/drivers/net/ethernet/apple/mace.c: In function ‘mace_probe’: > linux/drivers/net/ethernet/apple/mace.c:170:20: error: assignment of read-only location ‘*(dev->dev_addr + (sizetype)j)’ > 170 | dev->dev_addr[j] = rev ? bitrev8(addr[j]): addr[j]; > | ^ > linux/drivers/net/ethernet/apple/mace.c: In function ‘mace_reset’: > linux/drivers/net/ethernet/apple/mace.c:349:32: warning: passing argument 2 of ‘__mace_set_address’ discards ‘const’ qualifier from pointer target type > 349 | __mace_set_address(dev, dev->dev_addr); > | ~~~^~~~~~~~~~ > linux/drivers/net/ethernet/apple/mace.c:93:62: note: expected ‘void *’ but argument is of type ‘const unsigned char *’ > 93 | static void __mace_set_address(struct net_device *dev, void *addr); > | ~~~~~~^~~~ > linux/drivers/net/ethernet/apple/mace.c: In function ‘__mace_set_address’: > linux/drivers/net/ethernet/apple/mace.c:388:36: error: assignment of read-only location ‘*(dev->dev_addr + (sizetype)i)’ > 388 | out_8(&mb->padr, dev->dev_addr[i] = p[i]); > | ^ > > Fix it by making the modifications to a local macaddr variable and then > passing that to eth_hw_addr_set(), as well as adding some missing const > qualifiers. > > Signed-off-by: Michael Ellerman <mpe@...erman.id.au> Reviewed-by: Jakub Kicinski <kuba@...nel.org>
Powered by blists - more mailing lists