kernel_samsung_a53x/drivers/media/pci
Zheng Wang 6f35f1059c media: bttv: fix use after free error due to btv->timeout timer
[ Upstream commit bd5b50b329e850d467e7bcc07b2b6bde3752fbda ]

There may be some a race condition between timer function
bttv_irq_timeout and bttv_remove. The timer is setup in
probe and there is no timer_delete operation in remove
function. When it hit kfree btv, the function might still be
invoked, which will cause use after free bug.

This bug is found by static analysis, it may be false positive.

Fix it by adding del_timer_sync invoking to the remove function.

cpu0                cpu1
                  bttv_probe
                    ->timer_setup
                      ->bttv_set_dma
                        ->mod_timer;
bttv_remove
  ->kfree(btv);
                  ->bttv_irq_timeout
                    ->USE btv

Fixes: 162e6376ac58 ("media: pci: Convert timers to use timer_setup()")
Signed-off-by: Zheng Wang <zyytlz.wz@163.com>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2024-11-18 11:43:06 +01:00
..
b2c2 Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
bt8xx media: bttv: fix use after free error due to btv->timeout timer 2024-11-18 11:43:06 +01:00
cobalt Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
cx18 Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
cx88 Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
cx23885 Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
cx25821 Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
ddbridge Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
dm1105 Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
dt3155 Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
intel Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
ivtv Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
mantis Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
meye Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
netup_unidvb Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
ngene Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
pluto2 Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
pt1 Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
pt3 Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
saa7134 Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
saa7146 Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
saa7164 Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
smipcie Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
solo6x10 Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
sta2x11 Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
ttpci Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
tw68 Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
tw686x Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
tw5864 Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
Kconfig Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
Makefile Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00