linux-stable/drivers/net/ethernet
Steven Rostedt (Google) 292a089d78 treewide: Convert del_timer*() to timer_shutdown*()
Due to several bugs caused by timers being re-armed after they are
shutdown and just before they are freed, a new state of timers was added
called "shutdown".  After a timer is set to this state, then it can no
longer be re-armed.

The following script was run to find all the trivial locations where
del_timer() or del_timer_sync() is called in the same function that the
object holding the timer is freed.  It also ignores any locations where
the timer->function is modified between the del_timer*() and the free(),
as that is not considered a "trivial" case.

This was created by using a coccinelle script and the following
commands:

    $ cat timer.cocci
    @@
    expression ptr, slab;
    identifier timer, rfield;
    @@
    (
    -       del_timer(&ptr->timer);
    +       timer_shutdown(&ptr->timer);
    |
    -       del_timer_sync(&ptr->timer);
    +       timer_shutdown_sync(&ptr->timer);
    )
      ... when strict
          when != ptr->timer
    (
            kfree_rcu(ptr, rfield);
    |
            kmem_cache_free(slab, ptr);
    |
            kfree(ptr);
    )

    $ spatch timer.cocci . > /tmp/t.patch
    $ patch -p1 < /tmp/t.patch

Link: https://lore.kernel.org/lkml/20221123201306.823305113@linutronix.de/
Signed-off-by: Steven Rostedt (Google) <rostedt@goodmis.org>
Acked-by: Pavel Machek <pavel@ucw.cz> [ LED ]
Acked-by: Kalle Valo <kvalo@kernel.org> [ wireless ]
Acked-by: Paolo Abeni <pabeni@redhat.com> [ networking ]
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2022-12-25 13:38:09 -08:00
..
3com
8390
actions
adaptec
adi
aeroflex ethernet: aeroflex: fix potential skb leak in greth_init_rings() 2022-12-07 11:45:52 +01:00
agere
alacritech
allwinner
alteon
altera Merge git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net 2022-11-29 13:04:52 -08:00
amazon Merge git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net 2022-11-17 18:30:39 -08:00
amd Merge git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net 2022-12-13 09:49:29 +01:00
apm
apple net: apple: bmac: don't call dev_kfree_skb() under spin_lock_irqsave() 2022-12-12 09:53:10 +00:00
aquantia Merge git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net 2022-11-29 13:04:52 -08:00
arc
asix
atheros Merge git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net 2022-11-17 18:30:39 -08:00
broadcom Networking changes for 6.2. 2022-12-13 15:47:48 -08:00
brocade bna: Avoid clashing function prototypes 2022-11-21 08:17:59 +00:00
cadence
calxeda
cavium liquidio: use strscpy() to instead of strncpy() 2022-12-12 10:00:55 +00:00
chelsio Networking changes for 6.2. 2022-12-13 15:47:48 -08:00
cirrus
cisco
cortina
davicom net: dm9051: Fix missing dev_kfree_skb() in dm9051_loop_rx() 2022-11-23 12:43:14 +00:00
dec
dlink sundance: remove unused variable cnt 2022-11-17 13:18:30 +01:00
emulex
engleder tsnep: Rework RX buffer allocation 2022-12-02 10:47:49 +00:00
ezchip
faraday
freescale net: fec: check the return value of build_skb() 2022-12-20 11:33:24 -08:00
fujitsu
fungible net: devlink: clean-up empty devlink_ops::info_get() 2022-11-30 21:49:39 -08:00
google gve: Handle alternate miss completions 2022-11-21 10:52:14 +00:00
hisilicon net: hns3: use strscpy() to instead of strncpy() 2022-12-12 13:00:00 -08:00
huawei Merge git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net 2022-11-17 18:30:39 -08:00
i825xx
ibm ibmvnic: Update XPS assignments during affinity binding 2022-11-14 10:47:07 +00:00
intel treewide: Convert del_timer*() to timer_shutdown*() 2022-12-25 13:38:09 -08:00
litex
marvell treewide: Convert del_timer*() to timer_shutdown*() 2022-12-25 13:38:09 -08:00
mediatek net: ethernet: mtk_wed: fix possible deadlock if mtk_wed_wo_init fails 2022-12-08 19:47:43 -08:00
mellanox ipsec-next-2022-12-09 2022-12-09 20:06:35 -08:00
micrel
microchip net: microchip: vcap: Fix initialization of value and mask 2022-12-19 12:23:39 +00:00
microsoft v6.2 merge window pull request 2022-12-14 09:27:13 -08:00
moxa
mscc net: mscc: ocelot: issue a warning if stats are incorrectly ordered 2022-11-22 15:36:44 +01:00
myricom myri10ge: Fix an error handling path in myri10ge_probe() 2022-12-19 12:30:32 +00:00
natsemi
neterion ethernet: s2io: don't call dev_kfree_skb() under spin_lock_irqsave() 2022-12-12 09:38:24 +00:00
netronome nfp: fix unaligned io read of capabilities word 2022-12-19 12:35:20 +00:00
ni net: ethernet: nixge: fix NULL dereference 2022-11-28 11:09:51 +00:00
nvidia
nxp
oki-semi net: pch_gbe: fix pci device refcount leak while module exiting 2022-11-18 19:40:14 -08:00
packetengines
pasemi
pensando net: devlink: let the core report the driver name instead of the drivers 2022-11-30 21:49:38 -08:00
qlogic Merge git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net 2022-12-13 09:49:29 +01:00
qualcomm
rdc r6040: Fix kmemleak in probe and remove 2022-12-15 12:48:34 +01:00
realtek r8169: enable GRO software interrupt coalescing per default 2022-12-03 21:48:40 +00:00
renesas ravb: Fix "failed to switch device to config mode" message during unbind 2022-12-15 15:36:05 +01:00
rocker
samsung
seeq
sfc sfc: use sysfs_emit() to instead of scnprintf() 2022-12-06 20:37:38 -08:00
sgi
silan
sis
smsc
socionext
stmicro net: stmmac: fix errno when create_singlethread_workqueue() fails 2022-12-15 14:00:34 +01:00
sun treewide: Convert del_timer*() to timer_shutdown*() 2022-12-25 13:38:09 -08:00
sunplus
synopsys
tehuti
ti net: ethernet: ti: am65-cpsw: fix CONFIG_PM #ifdef 2022-12-16 21:13:52 -08:00
toshiba
tundra
vertexcom
via
wangxun net: libwx: Fix dead code for duplicate check 2022-11-18 10:53:13 +00:00
wiznet
xilinx Merge git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net 2022-12-13 09:49:29 +01:00
xircom
xscale ptp_ixp46x: convert .adjfreq to .adjfine 2022-11-11 10:58:39 +00:00
dnet.c net: ethernet: dnet: don't call dev_kfree_skb() under spin_lock_irqsave() 2022-12-12 09:56:17 +00:00
dnet.h
ec_bhf.c
ethoc.c
jme.c
jme.h
Kconfig
korina.c
lantiq_etop.c
lantiq_xrx200.c
Makefile