OpenCloudOS-Kernel/drivers/net/ethernet/arc
Jianglei Nie bc0e610a6e net: arc_emac: Fix use after free in arc_mdio_probe()
If bus->state is equal to MDIOBUS_ALLOCATED, mdiobus_free(bus) will free
the "bus". But bus->name is still used in the next line, which will lead
to a use after free.

We can fix it by putting the name in a local variable and make the
bus->name point to the rodata section "name",then use the name in the
error message without referring to bus to avoid the uaf.

Fixes: 95b5fc03c1 ("net: arc_emac: Make use of the helper function dev_err_probe()")
Signed-off-by: Jianglei Nie <niejianglei2021@163.com>
Link: https://lore.kernel.org/r/20220309121824.36529-1-niejianglei2021@163.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
2022-03-10 14:49:21 -08:00
..
Kconfig Merge git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net 2021-10-14 16:50:14 -07:00
Makefile treewide: Add SPDX license identifier - Makefile/Kconfig 2019-05-21 10:50:46 +02:00
emac.h net/arc: Delete driver version 2020-02-24 11:24:47 -08:00
emac_arc.c drivers/net/ethernet: add some basic kdoc tags 2020-09-25 16:29:00 -07:00
emac_main.c ethernet: use of_get_ethdev_address() 2021-10-07 13:39:51 +01:00
emac_mdio.c net: arc_emac: Fix use after free in arc_mdio_probe() 2022-03-10 14:49:21 -08:00
emac_rockchip.c net: arc: Demote non-compliant kernel-doc headers 2021-05-17 14:12:38 -07:00