linux-stable/drivers/atm
Duoming Zhou acf173d9e2 atm: idt77252: fix use-after-free bugs caused by tst_timer
commit 3f4093e2bf upstream.

There are use-after-free bugs caused by tst_timer. The root cause
is that there are no functions to stop tst_timer in idt77252_exit().
One of the possible race conditions is shown below:

    (thread 1)          |        (thread 2)
                        |  idt77252_init_one
                        |    init_card
                        |      fill_tst
                        |        mod_timer(&card->tst_timer, ...)
idt77252_exit           |  (wait a time)
                        |  tst_timer
                        |
                        |    ...
  kfree(card) // FREE   |
                        |    card->soft_tst[e] // USE

The idt77252_dev is deallocated in idt77252_exit() and used in
timer handler.

This patch adds del_timer_sync() in idt77252_exit() in order that
the timer handler could be stopped before the idt77252_dev is
deallocated.

Fixes: 1da177e4c3 ("Linux-2.6.12-rc2")
Signed-off-by: Duoming Zhou <duoming@zju.edu.cn>
Link: https://lore.kernel.org/r/20220805070008.18007-1-duoming@zju.edu.cn
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2022-08-25 11:09:29 +02:00
..
.gitignore
Kconfig Kconfig: Fix the reference to the IDT77105 Phy driver in the description of ATM_NICSTAR_USE_IDT77105 2019-09-21 07:14:13 +02:00
Makefile
adummy.c
ambassador.c
ambassador.h
atmtcp.c atm: fix atm_dev refcnt leaks in atmtcp_remove_persistent 2020-08-21 11:01:55 +02:00
eni.c atm: eni: Add check for dma_map_single 2022-03-23 09:00:34 +01:00
eni.h
firestream.c atm: firestream: check the return value of ioremap() in fs_init() 2022-03-23 09:00:33 +01:00
firestream.h
fore200e.c atm: fore200e: Do not drop const qualifier 2016-08-18 23:46:42 -07:00
fore200e.h
he.c atm: he: fix sign-extension overflow on large shift 2019-02-27 10:06:59 +01:00
he.h
horizon.c atm: horizon: Fix irq release error 2017-12-14 09:28:24 +01:00
horizon.h
idt77105.c atm: idt77252: fix null-ptr-dereference 2021-03-30 14:41:39 +02:00
idt77105.h
idt77252.c atm: idt77252: fix use-after-free bugs caused by tst_timer 2022-08-25 11:09:29 +02:00
idt77252.h
idt77252_tables.h
iphase.c atm: iphase: fix possible use-after-free in ia_module_exit() 2021-07-20 16:21:06 +02:00
iphase.h
lanai.c atm: lanai: dont run lanai_dev_close if not open 2021-03-30 14:41:39 +02:00
midway.h
nicstar.c atm: nicstar: register the interrupt handler in the right place 2021-07-20 16:21:08 +02:00
nicstar.h
nicstarmac.c
nicstarmac.copyright
solos-attrlist.c
solos-pci.c
suni.c
suni.h
tonga.h
uPD98401.h
uPD98402.c atm: uPD98402: fix incorrect allocation 2021-03-30 14:41:39 +02:00
uPD98402.h
zatm.c atm: zatm: Fix empty body Clang warnings 2019-11-28 18:28:32 +01:00
zatm.h
zeprom.h