android_kernel_sony_sdm845/drivers/media
Repository files (latest commit first)
Filename Latest commit message Latest commit date
Zheyu Ma c76d04d207 media: cx88: Fix a null-ptr-deref bug in buffer_prepare()
[ Upstream commit 2b064d91440b33fba5b452f2d1b31f13ae911d71 ]

When the driver calls cx88_risc_buffer() to prepare the buffer, the
function call may fail, resulting in a empty buffer and null-ptr-deref
later in buffer_queue().

The following log can reveal it:

[   41.822762] general protection fault, probably for non-canonical address 0xdffffc0000000000: 0000 [#1] PREEMPT SMP KASAN PTI
[   41.824488] KASAN: null-ptr-deref in range [0x0000000000000000-0x0000000000000007]
[   41.828027] RIP: 0010:buffer_queue+0xc2/0x500
[   41.836311] Call Trace:
[   41.836945]  __enqueue_in_driver+0x141/0x360
[   41.837262]  vb2_start_streaming+0x62/0x4a0
[   41.838216]  vb2_core_streamon+0x1da/0x2c0
[   41.838516]  __vb2_init_fileio+0x981/0xbc0
[   41.839141]  __vb2_perform_fileio+0xbf9/0x1120
[   41.840072]  vb2_fop_read+0x20e/0x400
[   41.840346]  v4l2_read+0x215/0x290
[   41.840603]  vfs_read+0x162/0x4c0

Fix this by checking the return value of cx88_risc_buffer()

[hverkuil: fix coding style issues]

Signed-off-by: Zheyu Ma <zheyuma97@gmail.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>
2022-10-26 13:15:47 +02:00
..
common media: saa7146: hexium_gemini: Fix a NULL pointer dereference in hexium_attach() 2022-01-27 08:47:37 +01:00
dvb-core media: dmxdev: fix UAF when dvb_register_device() fails 2022-01-27 08:47:33 +01:00
dvb-frontends media: dib8000: Fix a memleak in dib8000_init() 2022-01-27 08:47:34 +01:00
firewire media: firewire: firedtv-avc: fix a buffer overflow in avc_ca_pmt() 2022-01-29 10:15:58 +01:00
i2c media: mt9p031: Fix corrupted frame after restarting stream 2021-11-26 11:48:28 +01:00
mmc
pci media: cx88: Fix a null-ptr-deref bug in buffer_prepare() 2022-10-26 13:15:47 +02:00
platform media: xilinx: vipp: Fix refcount leak in xvip_graph_dma_init 2022-10-26 13:15:42 +02:00
radio media: si470x: Avoid card name truncation 2021-11-26 11:48:33 +01:00
rc media: igorplugusb: receiver overflow should be reported 2022-01-27 08:47:37 +01:00
spi gs1662: drop kfree for memory allocated with devm_kzalloc 2017-01-26 08:24:45 +01:00
tuners media: msi001: fix possible null-ptr-deref in msi001_probe() 2022-01-27 08:47:34 +01:00
usb media: pvrusb2: fix memory leak in pvr_probe 2022-09-05 10:23:57 +02:00
v4l2-core media: videobuf2-core: dequeue if start_streaming fails 2021-08-15 13:01:01 +02:00
cec-edid.c [media] cec-edid: check for IEEE identifier 2016-08-22 14:04:51 -03:00
Kconfig [media] media Kconfig: improve the spi integration 2016-09-19 14:37:05 -03:00
Makefile [media] Add GS1662 driver, a video serializer 2016-09-19 14:36:24 -03:00
media-device.c media: mc-device.c: don't memset __user pointer contents 2019-08-04 09:33:16 +02:00
media-devnode.c
media-entity.c media: entity: Fix stream count check 2017-07-12 15:01:02 +02:00