WSL2-Linux-Kernel/drivers/net
Arnd Bergmann 68eafe2947 nixge: fix mac address error handling again
commit a68229ca63 upstream.

The change to eth_hw_addr_set() caused gcc to correctly spot a
bug that was introduced in an earlier incorrect fix:

In file included from include/linux/etherdevice.h:21,
                 from drivers/net/ethernet/ni/nixge.c:7:
In function '__dev_addr_set',
    inlined from 'eth_hw_addr_set' at include/linux/etherdevice.h:319:2,
    inlined from 'nixge_probe' at drivers/net/ethernet/ni/nixge.c:1286:3:
include/linux/netdevice.h:4648:9: error: 'memcpy' reading 6 bytes from a region of size 0 [-Werror=stringop-overread]
 4648 |         memcpy(dev->dev_addr, addr, len);
      |         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

As nixge_get_nvmem_address() can return either NULL or an error
pointer, the NULL check is wrong, and we can end up reading from
ERR_PTR(-EOPNOTSUPP), which gcc knows to contain zero readable
bytes.

Make the function always return an error pointer again but fix
the check to match that.

Fixes: f3956ebb3b ("ethernet: use eth_hw_addr_set() instead of ether_addr_copy()")
Fixes: abcd3d6fc6 ("net: nixge: Fix error path for obtaining mac address")
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2023-07-27 08:47:05 +02:00
..
appletalk
arcnet arcnet: fix potential memory leak in com20020_probe() 2022-12-02 17:41:07 +01:00
bonding bonding: do not assume skb mac_header is set 2023-07-23 13:46:55 +02:00
caif
can can: kvaser_pciefd: Disable interrupts in probe error path 2023-05-24 17:36:54 +01:00
dsa net: dsa: vsc73xx: fix MTU configuration 2023-07-23 13:47:28 +02:00
ethernet nixge: fix mac address error handling again 2023-07-27 08:47:05 +02:00
fddi net: defxx: Fix missing err handling in dfx_init() 2022-12-31 13:14:18 +01:00
fjes
hamradio hamradio: baycom_epp: Fix return type of baycom_send_packet() 2022-12-31 13:14:41 +01:00
hippi
hyperv hv_netvsc: Check status in SEND_RNDIS_PKT completion message 2023-03-10 09:39:51 +01:00
ieee802154 ieee802154: hwsim: Fix possible memory leaks 2023-06-28 10:29:45 +02:00
ipa net: ipa: compute DMA pool size properly 2023-04-05 11:24:57 +02:00
ipvlan ipvlan: Fix return value of ipvlan_queue_xmit() 2023-07-23 13:46:56 +02:00
mctp
mdio net: mdio: mvusb: Fix an error handling path in mvusb_mdio_probe() 2023-05-24 17:36:41 +01:00
netdevsim netdevsim: fix uninitialized data in nsim_dev_trap_fa_cookie_write() 2023-07-23 13:47:45 +02:00
pcs net: pcs: xpcs: remove double-read of link state when using AN 2023-05-11 23:00:26 +09:00
phy net: phy: prevent stale pointer dereference in phy_init() 2023-07-27 08:47:04 +02:00
plip net: plip: don't call kfree_skb/dev_kfree_skb() under spin_lock_irq() 2022-12-14 11:37:29 +01:00
ppp pptp: Fix fib lookup calls. 2023-07-23 13:47:30 +02:00
slip
team net: fix stack overflow when LRO is disabled for virtual interfaces 2023-05-30 13:55:31 +01:00
usb net: usb: qmi_wwan: add support for Compal RXM-G1 2023-06-21 15:59:15 +02:00
vmxnet3 vmxnet3: correctly report csum_level for encapsulated packet 2023-01-12 11:59:09 +01:00
wan net: lapbether: only support ethernet devices 2023-06-21 15:59:18 +02:00
wireguard wireguard: netlink: send staged packets when setting initial private key 2023-07-23 13:47:37 +02:00
wireless wifi: airo: avoid uninitialized warning in airo_get_rate() 2023-07-23 13:47:44 +02:00
wwan net: wwan: iosm: fix dma_alloc_coherent incompatible pointer type 2022-12-08 11:28:41 +01:00
xen-netback xen/netback: use same error messages for same errors 2023-04-26 13:51:51 +02:00
Kconfig
LICENSE.SRC
Makefile
Space.c
bareudp.c
dummy.c
eql.c
geneve.c
gtp.c gtp: Fix use-after-free in __gtp_encap_destroy(). 2023-07-23 13:46:55 +02:00
ifb.c
loopback.c net: loopback: use NET_NAME_PREDICTABLE for name_assign_type 2022-12-21 17:36:38 +01:00
macsec.c net: macsec: fix net device access prior to holding a lock 2022-12-31 13:14:37 +01:00
macvlan.c macvlan: enforce a consistent minimal mtu 2022-11-26 09:24:50 +01:00
macvtap.c
mdio.c
mhi_net.c net: mhi: Fix memory leak in mhi_net_dellink() 2022-11-26 09:24:40 +01:00
mii.c
net_failover.c net/net_failover: fix txq exceeding warning 2023-04-05 11:24:55 +02:00
netconsole.c
nlmon.c
ntb_netdev.c ntb_netdev: Use dev_kfree_skb_any() in interrupt context 2022-12-31 13:14:20 +01:00
rionet.c
sb1000.c
sungem_phy.c
tap.c net: add vlan_get_protocol_and_depth() helper 2023-05-24 17:36:42 +01:00
thunderbolt.c net: thunderbolt: fix memory leak in tbnet_open() 2022-12-14 11:37:30 +01:00
tun.c tun: tun_chr_open(): correctly initialize socket uid 2023-03-10 09:39:15 +01:00
veth.c veth: Fix race with AF_XDP exposing old or uninitialized descriptors 2023-01-12 11:59:09 +01:00
virtio_net.c virtio_net: Fix error unwinding of XDP initialization 2023-05-24 17:36:51 +01:00
vrf.c
vsockmon.c
vxlan.c
xen-netfront.c xen-netfront: Fix NULL sring after live migration 2022-12-14 11:37:26 +01:00