mirror-linux/drivers/staging
Zheng Wang 3228cec23b media: rkvdec: fix use after free bug in rkvdec_remove
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>
2023-04-10 14:20:25 +01:00
..
axis-fifo
board
emxx_udc staging: emxx_udc: Add checks for dma_alloc_coherent() 2023-01-19 14:23:47 +01:00
fbtft
fieldbus
gdm724x
greybus Driver core changes for 6.3-rc1 2023-02-24 12:58:55 -08:00
iio
ks7010 staging: ks7010: use strscpy() to instead of strncpy() 2023-01-17 19:24:57 +01:00
media media: rkvdec: fix use after free bug in rkvdec_remove 2023-04-10 14:20:25 +01:00
most
nvec
octeon
olpc_dcon
pi433 staging: pi433: fix memory leak with using debugfs_lookup() 2023-02-06 10:45:34 +01:00
qlge
rtl8192e staging: rtl8192e: Remove call_usermodehelper starting RadioPower.sh 2023-03-08 17:08:59 +01:00
rtl8192u Staging: rtl8192u: ieee80211: Fix indentation errors by removing extra spaces 2023-01-17 19:27:13 +01:00
rtl8712
rtl8723bs staging: rtl8723bs: Pass correct parameters to cfg80211_get_bss() 2023-03-08 17:58:44 +01:00
rts5208 staging: rts5208: Added value check 2023-01-17 19:18:41 +01:00
sm750fb Staging driver changes for 6.2-rc1 2022-12-16 03:27:03 -08:00
vc04_services staging: vc04_services: mmal-vchiq: fix typo in comment 2023-01-31 11:17:21 +01:00
vme_user staging: vme_user: Replace the "<<" with BIT macro 2023-01-17 19:18:50 +01:00
vt6655 Staging driver changes for 6.2-rc1 2022-12-16 03:27:03 -08:00
vt6656
wlan-ng staging: wlan-ng: Remove unused code 2023-01-19 14:23:58 +01:00
Kconfig staging: r8188eu: delete driver 2023-03-09 10:06:28 +01:00
Makefile staging: r8188eu: delete driver 2023-03-09 10:06:28 +01:00