kernel_samsung_a53x/drivers/net/ethernet
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
..
3com Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
8390 Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
adaptec Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
aeroflex Backport mac80211 patches from linux-6.1.y 2024-06-15 16:29:20 -03:00
agere Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
alacritech Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
allwinner Backport mac80211 patches from linux-6.1.y 2024-06-15 16:29:20 -03:00
alteon Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
altera Backport mac80211 patches from linux-6.1.y 2024-06-15 16:29:20 -03:00
amazon net: ena: Fix XDP redirection error 2024-11-18 12:11:49 +01:00
amd amd-xgbe: propagate the correct speed and duplex status 2024-11-18 12:10:55 +01:00
apm Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
apple Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
aquantia net: atlantic: fix double free in ring reinit logic 2024-11-18 12:11:49 +01:00
arc Backport mac80211 patches from linux-6.1.y 2024-06-15 16:29:20 -03:00
atheros Backport mac80211 patches from linux-6.1.y 2024-06-15 16:29:20 -03:00
aurora Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
broadcom net: vlan: introduce skb_vlan_eth_hdr() 2024-11-18 12:11:48 +01:00
brocade Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
cadence Backport mac80211 patches from linux-6.1.y 2024-06-15 16:29:20 -03:00
calxeda Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
cavium Backport mac80211 patches from linux-6.1.y 2024-06-15 16:29:20 -03:00
chelsio chtls: fix tp->rcv_tstamp initialization 2024-11-18 11:42:50 +01:00
cirrus Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
cisco Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
cortina net: ethernet: cortina: Fix MTU max setting 2024-11-18 11:43:20 +01:00
davicom Backport mac80211 patches from linux-6.1.y 2024-06-15 16:29:20 -03:00
dec Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
dlink Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
emulex net: vlan: introduce skb_vlan_eth_hdr() 2024-11-18 12:11:48 +01:00
ezchip Backport mac80211 patches from linux-6.1.y 2024-06-15 16:29:20 -03:00
faraday Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
freescale net: fec: correct queue selection 2024-11-18 12:11:49 +01:00
fujitsu Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
google gve: Use size_add() in call to struct_size() 2024-11-18 11:42:47 +01:00
hisilicon net: vlan: introduce skb_vlan_eth_hdr() 2024-11-18 12:11:48 +01:00
huawei Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
i825xx Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
ibm Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
intel net: vlan: introduce skb_vlan_eth_hdr() 2024-11-18 12:11:48 +01:00
marvell octeontx2-pf: Add missing mutex lock in otx2_get_pauseparam 2024-11-18 12:11:38 +01:00
mediatek Backport mac80211 patches from linux-6.1.y 2024-06-15 16:29:20 -03:00
mellanox net/mlx5e: Check return value of snprintf writing to fw_version buffer for representors 2024-11-18 11:43:20 +01:00
micrel Backport mac80211 patches from linux-6.1.y 2024-06-15 16:29:20 -03:00
microchip Backport mac80211 patches from linux-6.1.y 2024-06-15 16:29:20 -03:00
moxa Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
mscc Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
myricom Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
natsemi Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
neterion Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
netronome Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
ni Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
nvidia Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
nxp Backport mac80211 patches from linux-6.1.y 2024-06-15 16:29:20 -03:00
oki-semi Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
packetengines Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
pasemi Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
pensando ionic: Fix dim work handling in split interrupt mode 2024-11-18 12:11:39 +01:00
qlogic qed: Fix a potential use-after-free in qed_cxt_tables_alloc 2024-11-18 12:11:49 +01:00
qualcomm qca_spi: Fix reset behavior 2024-11-18 12:11:48 +01:00
rdc Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
realtek r8169: fix rtl8125b PAUSE frames blasting when suspended 2024-11-18 12:11:48 +01:00
renesas net: ravb: Start TX queues after HW initialization succeeded 2024-11-18 12:11:11 +01:00
rocker Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
samsung Backport mac80211 patches from linux-6.1.y 2024-06-15 16:29:20 -03:00
seeq Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
sfc net: vlan: introduce skb_vlan_eth_hdr() 2024-11-18 12:11:48 +01:00
sgi Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
silan Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
sis Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
smsc Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
socionext Backport mac80211 patches from linux-6.1.y 2024-06-15 16:29:20 -03:00
stmicro net: stmmac: Handle disabled MDIO busses from devicetree 2024-11-18 12:11:49 +01:00
sun Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
synopsys Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
tehuti Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
ti Backport mac80211 patches from linux-6.1.y 2024-06-15 16:29:20 -03:00
toshiba net: spider_net: Use size_add() in call to struct_size() 2024-11-18 11:42:47 +01:00
tundra Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
via Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
wiznet Backport mac80211 patches from linux-6.1.y 2024-06-15 16:29:20 -03:00
xilinx net: axienet: Fix check for partial TX checksum 2024-11-18 12:10:55 +01:00
xircom Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
xscale Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
dnet.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
dnet.h Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
ec_bhf.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
ethoc.c Backport mac80211 patches from linux-6.1.y 2024-06-15 16:29:20 -03:00
fealnx.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
jme.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
jme.h Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
Kconfig Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
korina.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
lantiq_etop.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
lantiq_xrx200.c Backport mac80211 patches from linux-6.1.y 2024-06-15 16:29:20 -03:00
Makefile Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00