android_kernel_xiaomi_sm8450/drivers/net
Vladimir Oltean 22249886dc net: dsa: mv88e6xxx: fix use-after-free in mv88e6xxx_mdios_unregister
[ Upstream commit 51a04ebf21122d5c76a716ecd9bfc33ea44b2b39 ]

Since struct mv88e6xxx_mdio_bus *mdio_bus is the bus->priv of something
allocated with mdiobus_alloc_size(), this means that mdiobus_free(bus)
will free the memory backing the mdio_bus as well. Therefore, the
mdio_bus->list element is freed memory, but we continue to iterate
through the list of MDIO buses using that list element.

To fix this, use the proper list iterator that handles element deletion
by keeping a copy of the list element next pointer.

Fixes: f53a2ce893b2 ("net: dsa: mv88e6xxx: don't use devres for mdiobus")
Reported-by: Rafael Richter <rafael.richter@gin.de>
Signed-off-by: Vladimir Oltean <vladimir.oltean@nxp.com>
Link: https://lore.kernel.org/r/20220210174017.3271099-1-vladimir.oltean@nxp.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2022-02-16 12:54:27 +01:00
..
appletalk
arcnet
bonding bonding: pair enable_port with slave_arr_updates 2022-02-16 12:54:25 +01:00
caif net: caif: fix memory leak in ldisc_open 2021-06-30 08:47:21 -04:00
can can: mcp251xfd: mcp251xfd_tef_obj_read(): fix typo in error message 2022-01-27 10:54:28 +01:00
dsa net: dsa: mv88e6xxx: fix use-after-free in mv88e6xxx_mdios_unregister 2022-02-16 12:54:27 +01:00
ethernet net: mscc: ocelot: fix mutex lock error during ethtool stats read 2022-02-16 12:54:27 +01:00
fddi net: fddi: fix UAF in fza_probe 2021-07-25 14:36:20 +02:00
fjes fjes: Check for error irq 2021-12-29 12:25:57 +01:00
hamradio yam: fix a memory leak in yam_siocdevprivate() 2022-02-01 17:25:47 +01:00
hippi
hyperv
ieee802154 net: ieee802154: ca8210: Stop leaking skb's 2022-02-08 18:30:37 +01:00
ipa net: ipa: prevent concurrent replenish 2022-02-05 12:37:55 +01:00
ipvlan
mdio net: mdio: aspeed: Add missing MODULE_DEVICE_TABLE 2022-02-16 12:54:26 +01:00
netdevsim netdevsim: Zero-initialize memory for new map's value in function nsim_bpf_map_alloc 2021-12-22 09:30:55 +01:00
pcs
phy net: phy: marvell: Fix MDI-x polarity setting in 88e1118-compatible PHYs 2022-02-16 12:54:17 +01:00
plip
ppp ppp: ensure minimum packet size in ppp_write() 2022-01-27 10:54:01 +01:00
slip
team
usb ipheth: fix EOVERFLOW in ipheth_rcvbulk_callback 2022-02-05 12:37:56 +01:00
vmxnet3 vmxnet3: do not stop tx queues after netif_device_detach() 2021-11-18 14:03:43 +01:00
wan
wimax
wireguard wireguard: ratelimiter: use kvcalloc() instead of kvzalloc() 2021-12-08 09:03:23 +01:00
wireless ath10k: Fix the MTU size on QCA9377 SDIO 2022-01-27 10:54:36 +01:00
xen-netback xen/netback: don't queue unlimited number of packages 2021-12-22 09:31:00 +01:00
bareudp.c bareudp: Fix invalid read beyond skb's linear data 2021-08-18 08:59:11 +02:00
dummy.c
eql.c
geneve.c
gtp.c
ifb.c ifb: fix building without CONFIG_NET_CLS_ACT 2021-11-18 14:03:49 +01:00
Kconfig ifb: Depend on netfilter alternatively to tc 2021-11-18 14:03:46 +01:00
LICENSE.SRC
loopback.c
macsec.c net: macsec: Verify that send_sci is on when setting Tx sci explicitly 2022-02-08 18:30:38 +01:00
macvlan.c
macvtap.c
Makefile
mdio.c
mii.c
net_failover.c
netconsole.c
nlmon.c
ntb_netdev.c
rionet.c
sb1000.c
Space.c
sungem_phy.c
tap.c
thunderbolt.c
tun.c tun: fix bonding active backup with arp monitoring 2021-11-26 10:39:18 +01:00
veth.c veth: fix races around rq->rx_notify_masked 2022-02-16 12:54:26 +01:00
virtio_net.c virtio-net: use NETIF_F_GRO_HW instead of NETIF_F_LRO 2021-08-26 08:35:48 -04:00
vrf.c vrf: don't run conntrack on vrf with !dflt qdisc 2021-12-14 11:32:36 +01:00
vsockmon.c
vxlan.c vxlan: add missing rcu_read_lock() in neigh_reduce() 2021-07-14 16:56:25 +02:00
xen-netfront.c xen/netfront: harden netfront against event channel storms 2021-12-22 09:30:59 +01:00