linux/drivers/media/test-drivers
Sishuai Gong 54921a8f31 media: vivid: fix the racy dev->radio_tx_rds_owner
There is a race over dev->radio_tx_rds_owner between the two functions
mentioned below:

Thread-1                Thread-2
vivid_fop_release()     vivid_radio_rx_read()
mutex_unlock(&dev->mutex)
                        mutex_lock_interruptible(&dev->mutex)
                        ...
                        dev->radio_rx_rds_owner = file->private_data;
...
if (file->private_data == dev->radio_rx_rds_owner) {
        dev->radio_tx_rds_last_block = 0;
        dev->radio_tx_rds_owner = NULL;
}

This race can be fixed by only releasing the lock after vivid_fop_release()
finishes the checks.

Signed-off-by: Sishuai Gong <sishuai.system@gmail.com>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
2023-08-14 20:27:58 +02:00
..
vicodec media: vicodec-core: Convert to platform remove callback returning void 2023-04-11 16:59:21 +02:00
vidtv media: Switch i2c drivers back to use .probe() 2023-05-25 16:21:21 +02:00
vimc media: Zero-initialize all structures passed to subdev pad operations 2023-04-12 09:46:06 +02:00
visl media: visl-core: Convert to platform remove callback returning void 2023-04-11 16:59:21 +02:00
vivid media: vivid: fix the racy dev->radio_tx_rds_owner 2023-08-14 20:27:58 +02:00
Kconfig media: visl: add virtual stateless decoder driver 2022-11-25 07:32:16 +00:00
Makefile media: visl: add virtual stateless decoder driver 2022-11-25 07:32:16 +00:00
vim2m.c media: vim2m: Convert to platform remove callback returning void 2023-04-11 16:59:21 +02:00