linux-stable/drivers/media
Pavel Skripkin 8c6fdf62bf media: mxl111sf: change mutex_init() location
commit 44870a9e7a upstream.

Syzbot reported, that mxl111sf_ctrl_msg() uses uninitialized
mutex. The problem was in wrong mutex_init() location.

Previous mutex_init(&state->msg_lock) call was in ->init() function, but
dvb_usbv2_init() has this order of calls:

	dvb_usbv2_init()
	  dvb_usbv2_adapter_init()
	    dvb_usbv2_adapter_frontend_init()
	      props->frontend_attach()

	  props->init()

Since mxl111sf_* devices call mxl111sf_ctrl_msg() in ->frontend_attach()
internally we need to initialize state->msg_lock before
frontend_attach(). To achieve it, ->probe() call added to all mxl111sf_*
devices, which will simply initiaize mutex.

Reported-and-tested-by: syzbot+5ca0bf339f13c4243001@syzkaller.appspotmail.com

Fixes: 8572211842 ("[media] mxl111sf: convert to new DVB USB")
Signed-off-by: Pavel Skripkin <paskripkin@gmail.com>
Signed-off-by: Sean Young <sean@mess.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2021-12-22 09:32:50 +01:00
..
cec media: cec: copy sequence field for the reply 2021-12-01 09:04:41 +01:00
common media: videobuf2-dma-sg: Fix buf->vb NULL pointer dereference 2021-11-18 19:17:21 +01:00
dvb-core media: dvb-core: frontend: make GET/SET safer 2021-06-17 09:29:11 +02:00
dvb-frontends media: dvb-frontends: mn88443x: Handle errors of clk_prepare_enable() 2021-11-18 19:16:30 +01:00
firewire media: firewire: firedtv-avc: fix a buffer overflow in avc_ca_pmt() 2021-11-06 14:13:30 +01:00
i2c media: i2c: ths8200 needs V4L2_ASYNC 2021-11-18 19:16:28 +01:00
mc media: mc-device.c: use DEVICE_ATTR_RO() helper macro 2021-08-04 14:43:50 +02:00
mmc
pci media: ivtv: fix build for UML 2021-11-18 19:16:34 +01:00
platform media: venus: fix vpp frequency calculation for decoder 2021-11-18 19:16:30 +01:00
radio media: si470x: Avoid card name truncation 2021-11-18 19:16:29 +01:00
rc media: ir_toy: assignment to be16 should be of correct type 2021-11-18 19:16:34 +01:00
spi media: cxd2880-spi: Fix a null pointer dereference on error handling path 2021-11-18 19:16:27 +01:00
test-drivers media: vidtv: move kfree(dvb) to vidtv_bridge_dev_release() 2021-11-18 19:17:20 +01:00
tuners media: m88rs6000t: avoid potential out-of-bounds reads on arrays 2021-03-22 17:41:39 +01:00
usb media: mxl111sf: change mutex_init() location 2021-12-22 09:32:50 +01:00
v4l2-core media: v4l2-core: fix VIDIOC_DQEVENT handling on non-x86 2021-12-01 09:04:45 +01:00
Kconfig media: Correct 'so' 2021-03-22 11:52:09 +01:00
Makefile