linux/drivers/staging
Zheng Wang 6a17add9c6 media: rkvdec: fix use after free bug in rkvdec_remove
[ Upstream commit 3228cec23b ]

In rkvdec_probe, rkvdec->watchdog_work is bound with
rkvdec_watchdog_func. Then rkvdec_vp9_run may
be called to start the work.

If we remove the module which will call rkvdec_remove
 to make cleanup, there may be a unfinished work.
 The possible sequence is as follows, which will
 cause a typical UAF bug.

Fix it by canceling the work before cleanup in rkvdec_remove.

CPU0                  CPU1

                    |rkvdec_watchdog_func
rkvdec_remove       |
 rkvdec_v4l2_cleanup|
  v4l2_m2m_release  |
    kfree(m2m_dev); |
                    |
                    | v4l2_m2m_get_curr_priv
                    |   m2m_dev->curr_ctx //use

Fixes: cd33c83044 ("media: rkvdec: Add the rkvdec driver")
Signed-off-by: Zheng Wang <zyytlz.wz@163.com>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2023-05-11 23:03:14 +09:00
..
axis-fifo
board
emxx_udc staging: emxx_udc: Add checks for dma_alloc_coherent() 2023-03-11 13:55:34 +01:00
fbtft
fieldbus
gdm724x
greybus
iio staging: iio: resolver: ads1210: fix config mode 2023-05-11 23:03:01 +09:00
ks7010
media media: rkvdec: fix use after free bug in rkvdec_remove 2023-05-11 23:03:14 +09:00
most
nvec
octeon
olpc_dcon
pi433 staging: pi433: fix memory leak with using debugfs_lookup() 2023-03-11 13:55:36 +01:00
qlge
r8188eu
rtl8192e staging: rtl8192e: Remove call_usermodehelper starting RadioPower.sh 2023-03-13 10:21:31 +01:00
rtl8192u
rtl8712
rtl8723bs staging: rtl8723bs: Pass correct parameters to cfg80211_get_bss() 2023-03-17 08:50:16 +01:00
rts5208
sm750fb
vc04_services staging: vchiq_arm: fix enum vchiq_status return types 2023-01-24 07:24:35 +01:00
vme_user
vt6655
vt6656
wlan-ng
Kconfig
Makefile