linux-stable/drivers/media/pci
Duoming Zhou 07821524f6 media: netup_unidvb: fix use-after-free at del_timer()
[ Upstream commit 0f5bb36bf9 ]

When Universal DVB card is detaching, netup_unidvb_dma_fini()
uses del_timer() to stop dma->timeout timer. But when timer
handler netup_unidvb_dma_timeout() is running, del_timer()
could not stop it. As a result, the use-after-free bug could
happen. The process is shown below:

    (cleanup routine)          |        (timer routine)
                               | mod_timer(&dev->tx_sim_timer, ..)
netup_unidvb_finidev()         | (wait a time)
  netup_unidvb_dma_fini()      | netup_unidvb_dma_timeout()
    del_timer(&dma->timeout);  |
                               |   ndev->pci_dev->dev //USE

Fix by changing del_timer() to del_timer_sync().

Link: https://lore.kernel.org/linux-media/20230308125514.4208-1-duoming@zju.edu.cn
Fixes: 52b1eaf4c5 ("[media] netup_unidvb: NetUP Universal DVB-S/S2/T/T2/C PCI-E card driver")
Signed-off-by: Duoming Zhou <duoming@zju.edu.cn>
Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2023-05-24 17:32:45 +01:00
..
b2c2
bt8xx media: v4l: ioctl: Set bus_info in v4l_querycap() 2022-04-24 08:07:08 +01:00
cobalt media: Kconfig: cleanup VIDEO_DEV dependencies 2022-03-18 05:58:35 +01:00
cx18 media: pci/cx18: fix repeated words in comments 2022-09-24 08:47:29 +02:00
cx88 media: cx88: add IR remote support for NotOnlyTV LV3H 2022-09-24 11:21:43 +02:00
cx23885 media: cx23885: Fix a null-ptr-deref bug in buffer_prepare() and buffer_finish() 2023-05-24 17:32:34 +01:00
cx25821 media: cx25821: request_irq -> devm_request_irq 2022-05-13 11:02:22 +02:00
ddbridge media: ddbridge: Remove useless license text when SPDX-License-Identifier is already used 2022-06-27 08:57:24 +01:00
dm1105 media: dm1105: Fix use after free bug in dm1105_remove due to race condition 2023-05-11 23:03:15 +09:00
dt3155 media: v4l: ioctl: Set bus_info in v4l_querycap() 2022-04-24 08:07:08 +01:00
intel media: ipu3-cio2: Fix PM runtime usage_count in driver unbind 2023-03-10 09:34:26 +01:00
ivtv media: ivtv: Fix typo 'the the' in comment 2022-08-29 15:32:14 +02:00
mantis
netup_unidvb media: netup_unidvb: fix use-after-free at del_timer() 2023-05-24 17:32:45 +01:00
ngene media: media/pci/ngene/ngene.h: remove #ifdef NGENE_V4L 2022-08-29 15:37:30 +02:00
pluto2
pt1
pt3 freezer,sched: Rewrite core freezer logic 2022-09-07 21:53:50 +02:00
saa7134 media: saa7134: fix use after free bug in saa7134_finidev due to race condition 2023-05-11 23:03:15 +09:00
saa7164 media: saa7164: fix missing pci_disable_device() 2022-12-31 13:32:22 +01:00
smipcie
solo6x10 media: solo6x10: fix possible memory leak in solo_sysfs_init() 2022-12-31 13:32:13 +01:00
sta2x11 media: sta2x11: remove VIRT_TO_BUS dependency 2022-06-27 09:12:14 +01:00
tw68 media: pci: tw68: Fix null-ptr-deref bug in buf prepare and finish 2023-05-24 17:32:34 +01:00
tw686x media: tw686x: Fix memory leak in tw686x_video_init 2022-06-27 09:24:45 +01:00
tw5864 media: tw5864: Convert to use managed functions pcim* and devm* 2022-06-20 10:30:34 +01:00
zoran media: zoran: move to mainline 2022-08-29 15:33:45 +02:00
Kconfig media: saa7146: deprecate hexium_gemini/orion, mxb and ttpci 2022-08-29 16:46:38 +02:00
Makefile media: saa7146: deprecate hexium_gemini/orion, mxb and ttpci 2022-08-29 16:46:38 +02:00