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 Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
hw_atl2 Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
macsec Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
aq_cfg.h Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
aq_common.h Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
aq_drvinfo.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
aq_drvinfo.h Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
aq_ethtool.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
aq_ethtool.h Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
aq_filters.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
aq_filters.h Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
aq_hw.h Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
aq_hw_utils.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
aq_hw_utils.h Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
aq_macsec.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
aq_macsec.h Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
aq_main.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
aq_main.h Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
aq_nic.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
aq_nic.h Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
aq_pci_func.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
aq_pci_func.h Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
aq_phy.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
aq_phy.h Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
aq_ptp.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
aq_ptp.h Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
aq_ring.c net: atlantic: fix double free in ring reinit logic 2024-11-18 12:11:49 +01:00
aq_ring.h Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
aq_rss.h Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
aq_utils.h Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
aq_vec.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
aq_vec.h Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
Makefile Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00