linux-uconsole/drivers/media
Luke Nowakowski-Krijger b3836af856 media: radio-raremono: change devm_k*alloc to k*alloc
commit c666355e60 upstream.

Change devm_k*alloc to k*alloc to manually allocate memory

The manual allocation and freeing of memory is necessary because when
the USB radio is disconnected, the memory associated with devm_k*alloc
is freed. Meaning if we still have unresolved references to the radio
device, then we get use-after-free errors.

This patch fixes this by manually allocating memory, and freeing it in
the v4l2.release callback that gets called when the last radio device
exits.

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

Signed-off-by: Luke Nowakowski-Krijger <lnowakow@eng.ucsd.edu>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
[hverkuil-cisco@xs4all.nl: cleaned up two small checkpatch.pl warnings]
[hverkuil-cisco@xs4all.nl: prefix subject with driver name]
Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2019-08-04 09:30:54 +02:00
..
cec media: cec-pin: fix broken tx_ignore_nack_until_eom error injection 2019-01-09 17:38:46 +01:00
common media: videobuf2-dma-sg: Prevent size from overflowing 2019-07-26 09:14:24 +02:00
dvb-core media: dvb_frontend: ensure that the step is ok for both FE and tuner 2018-08-02 18:11:46 -04:00
dvb-frontends tua6100: Avoid build warnings. 2019-07-26 09:14:03 +02:00
firewire media: firewire: Fix app_info parameter type in avc_ca{,_app}_info 2019-01-26 09:32:37 +01:00
i2c media: i2c: fix warning same module names 2019-07-26 09:14:10 +02:00
mmc media: siano: use GFP_DMA only for smssdio 2018-05-15 08:04:42 -04:00
pci media: saa7164: fix remove_proc_entry warning 2019-07-26 09:14:02 +02:00
platform media: coda: Remove unbalanced and unneeded mutex unlock 2019-07-26 09:14:24 +02:00
radio media: radio-raremono: change devm_k*alloc to k*alloc 2019-08-04 09:30:54 +02:00
rc media: spi: IR LED: add missing of table registration 2019-07-26 09:13:59 +02:00
spi media: cxd2880-spi: Modified how to declare structure 2018-05-05 10:37:12 -04:00
tuners Merge branch 'i2c/for-4.19' of git://git.kernel.org/pub/scm/linux/kernel/git/wsa/linux 2018-08-21 17:40:46 -07:00
usb media: pvrusb2: use a different format for warnings 2019-08-04 09:30:54 +02:00
v4l2-core media: v4l2: Test type instead of cfg->type in v4l2_ctrl_new_custom() 2019-07-26 09:14:24 +02:00
Kconfig media: cec: Kconfig coding style issue 2018-05-09 16:26:50 -04:00
Makefile
media-device.c media: mc-device.c: don't memset __user pointer contents 2019-07-26 09:14:02 +02:00
media-devnode.c MAINTAINERS & files: Canonize the e-mails I use at files 2018-05-04 06:21:06 -04:00
media-entity.c media: media.h: reorganize header to make it easier to understand 2018-02-26 10:14:46 -05:00