kernel_samsung_a53x/drivers/net/ethernet/aquantia/atlantic
Igor Russkikh 31295e1ac6 net: atlantic: fix double free in ring reinit logic
[ Upstream commit 7bb26ea74aa86fdf894b7dbd8c5712c5b4187da7 ]

Driver has a logic leak in ring data allocation/free,
where double free may happen in aq_ring_free if system is under
stress and driver init/deinit is happening.

The probability is higher to get this during suspend/resume cycle.

Verification was done simulating same conditions with

    stress -m 2000 --vm-bytes 20M --vm-hang 10 --backoff 1000
    while true; do sudo ifconfig enp1s0 down; sudo ifconfig enp1s0 up; done

Fixed by explicitly clearing pointers to NULL on deallocation

Fixes: 018423e90bee ("net: ethernet: aquantia: Add ring support code")
Reported-by: Linus Torvalds <torvalds@linux-foundation.org>
Closes: https://lore.kernel.org/netdev/CAHk-=wiZZi7FcvqVSUirHBjx0bBUZ4dFrMDVLc3+3HCrtq0rBA@mail.gmail.com/
Signed-off-by: Igor Russkikh <irusskikh@marvell.com>
Link: https://lore.kernel.org/r/20231213094044.22988-1-irusskikh@marvell.com
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2024-11-18 12:11:49 +01:00
..
hw_atl
hw_atl2
macsec
aq_cfg.h
aq_common.h
aq_drvinfo.c
aq_drvinfo.h
aq_ethtool.c
aq_ethtool.h
aq_filters.c
aq_filters.h
aq_hw.h
aq_hw_utils.c
aq_hw_utils.h
aq_macsec.c
aq_macsec.h
aq_main.c
aq_main.h
aq_nic.c
aq_nic.h
aq_pci_func.c
aq_pci_func.h
aq_phy.c
aq_phy.h
aq_ptp.c
aq_ptp.h
aq_ring.c net: atlantic: fix double free in ring reinit logic 2024-11-18 12:11:49 +01:00
aq_ring.h
aq_rss.h
aq_utils.h
aq_vec.c
aq_vec.h
Makefile