linux/drivers/net
Horatiu Vultur 48fae67d83 lan966x: Fix crash when adding interface under a lag
[ Upstream commit 15faa1f67a ]

There is a crash when adding one of the lan966x interfaces under a lag
interface. The issue can be reproduced like this:
ip link add name bond0 type bond miimon 100 mode balance-xor
ip link set dev eth0 master bond0

The reason is because when adding a interface under the lag it would go
through all the ports and try to figure out which other ports are under
that lag interface. And the issue is that lan966x can have ports that are
NULL pointer as they are not probed. So then iterating over these ports
it would just crash as they are NULL pointers.
The fix consists in actually checking for NULL pointers before accessing
something from the ports. Like we do in other places.

Fixes: cabc9d4933 ("net: lan966x: Add lag support for lan966x")
Signed-off-by: Horatiu Vultur <horatiu.vultur@microchip.com>
Reviewed-by: Michal Swiatkowski <michal.swiatkowski@linux.intel.com>
Reviewed-by: Simon Horman <horms@kernel.org>
Link: https://lore.kernel.org/r/20240206123054.3052966-1-horatiu.vultur@microchip.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2024-02-23 09:24:51 +01:00
..
appletalk
arcnet arcnet: restoring support for multiple Sohard Arcnet cards 2023-12-13 18:45:05 +01:00
bonding bonding: do not report NETDEV_XDP_ACT_XSK_ZEROCOPY 2024-02-23 09:24:50 +01:00
caif
can can: dev: can_put_echo_skb(): don't crash kernel if can_priv::echo_skb is accessed out of bounds 2023-11-20 11:59:00 +01:00
dsa net: dsa: qca8k: fix illegal usage of GPIO 2024-02-05 20:14:36 +00:00
ethernet lan966x: Fix crash when adding interface under a lag 2024-02-23 09:24:51 +01:00
fddi
fjes fjes: fix memleaks in fjes_hw_setup 2024-01-31 16:19:05 -08:00
hamradio
hippi
hyperv hv_netvsc: Calculate correct ring size when PAGE_SIZE is not 4 Kbytes 2024-01-31 16:19:06 -08:00
ieee802154
ipa net: ipa: fix one GSI register field width 2023-12-03 07:33:05 +01:00
ipvlan ipvlan: add ipvlan_route_v6_outbound() helper 2023-11-28 17:19:50 +00:00
mctp
mdio
netdevsim netdevsim: avoid potential loop in nsim_dev_trap_report_work() 2024-02-16 19:10:47 +01:00
pcs
phy net: phy: mediatek-ge-soc: sync driver with MediaTek SDK 2024-02-05 20:14:35 +00:00
plip
ppp ppp_async: limit MRU to 64K 2024-02-16 19:10:50 +01:00
pse-pd
slip
team team: Fix use-after-free when an option instance allocation fails 2023-12-20 17:02:02 +01:00
thunderbolt
usb net: usb: ax88179_178a: avoid two consecutive device resets 2024-02-05 20:14:19 +00:00
vmxnet3
vxlan
wan
wireguard wireguard: use DEV_STATS_INC() 2023-12-03 07:33:03 +01:00
wireless wifi: iwlwifi: uninitialized variable in iwl_acpi_get_ppag_table() 2024-02-23 09:24:49 +01:00
wwan
xen-netback xen-netback: don't produce zero-size SKB frags 2024-01-25 15:35:41 -08:00
amt.c amt: do not use overwrapped cb area 2024-01-25 15:35:56 -08:00
bareudp.c
dummy.c
eql.c
geneve.c
gtp.c
ifb.c
Kconfig
LICENSE.SRC
loopback.c
macsec.c net: add DEV_STATS_READ() helper 2023-11-20 11:59:04 +01:00
macvlan.c macvlan: Don't propagate promisc change to lower dev in passthru 2023-11-28 17:19:54 +00:00
macvtap.c
Makefile
mdio.c
mhi_net.c
mii.c
net_failover.c
netconsole.c
nlmon.c
ntb_netdev.c
rionet.c
sb1000.c
Space.c
sungem_phy.c
tap.c
tun.c tun: add missing rx stats accounting in tun_xdp_act 2024-01-31 16:19:01 -08:00
veth.c veth: Use tstats per-CPU traffic counters 2023-12-03 07:33:09 +01:00
virtio_net.c virtio_net: Fix "‘%d’ directive writing between 1 and 11 bytes into a region of size 10" warnings 2024-02-05 20:14:33 +00:00
vrf.c net: Move {l,t,d}stats allocation to core and convert veth & vrf 2023-12-03 07:33:04 +01:00
vsockmon.c
xen-netfront.c