mirror-linux/drivers/net
Fedor Pchelkin c2a94de38c wifi: ath9k: hif_usb: fix memory leak of urbs in ath9k_hif_usb_dealloc_tx_urbs()
Syzkaller reports a long-known leak of urbs in
ath9k_hif_usb_dealloc_tx_urbs().

The cause of the leak is that usb_get_urb() is called but usb_free_urb()
(or usb_put_urb()) is not called inside usb_kill_urb() as urb->dev or
urb->ep fields have not been initialized and usb_kill_urb() returns
immediately.

The patch removes trying to kill urbs located in hif_dev->tx.tx_buf
because hif_dev->tx.tx_buf is not supposed to contain urbs which are in
pending state (the pending urbs are stored in hif_dev->tx.tx_pending).
The tx.tx_lock is acquired so there should not be any changes in the list.

Found by Linux Verification Center (linuxtesting.org) with Syzkaller.

Fixes: 03fb92a432 ("ath9k: hif_usb: fix race condition between usb_get_urb() and usb_kill_anchored_urbs()")
Signed-off-by: Fedor Pchelkin <pchelkin@ispras.ru>
Signed-off-by: Alexey Khoroshilov <khoroshilov@ispras.ru>
Acked-by: Toke Høiland-Jørgensen <toke@toke.dk>
Signed-off-by: Kalle Valo <quic_kvalo@quicinc.com>
Link: https://lore.kernel.org/r/20220725151359.283704-1-pchelkin@ispras.ru
2022-10-11 07:33:22 +03:00
..
appletalk
arcnet
bonding net: move from strlcpy with unused retval to strscpy 2022-08-31 14:11:07 -07:00
caif
can net: move from strlcpy with unused retval to strscpy 2022-08-31 14:11:07 -07:00
dsa Merge git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net 2022-09-01 12:58:02 -07:00
ethernet net: fec: add stop mode support for imx8 platform 2022-09-03 09:54:34 +01:00
fddi
fjes net: move from strlcpy with unused retval to strscpy 2022-08-31 14:11:07 -07:00
hamradio net: move from strlcpy with unused retval to strscpy 2022-08-31 14:11:07 -07:00
hippi
hyperv net: move from strlcpy with unused retval to strscpy 2022-08-31 14:11:07 -07:00
ieee802154 Merge git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net 2022-09-01 12:58:02 -07:00
ipa net: ipa: track polled transactions with an ID 2022-09-02 12:08:44 +01:00
ipvlan net: move from strlcpy with unused retval to strscpy 2022-08-31 14:11:07 -07:00
mctp
mdio
netdevsim netdevsim: remove redundant variable ret 2022-09-01 20:50:48 -07:00
pcs
phy Merge git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net 2022-09-01 12:58:02 -07:00
plip
ppp
slip
team net: move from strlcpy with unused retval to strscpy 2022-08-31 14:11:07 -07:00
usb r8152: Add MAC passthrough support for Lenovo Travel Hub 2022-09-03 09:53:38 +01:00
vmxnet3 net: move from strlcpy with unused retval to strscpy 2022-08-31 14:11:07 -07:00
vxlan net: move from strlcpy with unused retval to strscpy 2022-08-31 14:11:07 -07:00
wan
wireguard genetlink: start to validate reserved header bytes 2022-08-29 12:47:15 +01:00
wireless wifi: ath9k: hif_usb: fix memory leak of urbs in ath9k_hif_usb_dealloc_tx_urbs() 2022-10-11 07:33:22 +03:00
wwan
xen-netback
Kconfig
LICENSE.SRC
Makefile
Space.c net: move from strlcpy with unused retval to strscpy 2022-08-31 14:11:07 -07:00
amt.c
bareudp.c
dummy.c net: move from strlcpy with unused retval to strscpy 2022-08-31 14:11:07 -07:00
eql.c
geneve.c net: move from strlcpy with unused retval to strscpy 2022-08-31 14:11:07 -07:00
gtp.c genetlink: start to validate reserved header bytes 2022-08-29 12:47:15 +01:00
ifb.c
loopback.c
macsec.c genetlink: start to validate reserved header bytes 2022-08-29 12:47:15 +01:00
macvlan.c net: move from strlcpy with unused retval to strscpy 2022-08-31 14:11:07 -07:00
macvtap.c
mdio.c
mhi_net.c
mii.c
net_failover.c net: move from strlcpy with unused retval to strscpy 2022-08-31 14:11:07 -07:00
netconsole.c net: move from strlcpy with unused retval to strscpy 2022-08-31 14:11:07 -07:00
nlmon.c
ntb_netdev.c net: move from strlcpy with unused retval to strscpy 2022-08-31 14:11:07 -07:00
rionet.c net: move from strlcpy with unused retval to strscpy 2022-08-31 14:11:07 -07:00
sb1000.c
sungem_phy.c
tap.c
thunderbolt.c net: thunderbolt: Update module description with mention of USB4 2022-08-31 14:05:12 +01:00
tun.c net: move from strlcpy with unused retval to strscpy 2022-08-31 14:11:07 -07:00
veth.c net: move from strlcpy with unused retval to strscpy 2022-08-31 14:11:07 -07:00
virtio_net.c net: move from strlcpy with unused retval to strscpy 2022-08-31 14:11:07 -07:00
vrf.c net: move from strlcpy with unused retval to strscpy 2022-08-31 14:11:07 -07:00
vsockmon.c
xen-netfront.c