linux-stable/drivers/media/common
Hans de Goede d55c3ee6b4 media: videobuf2-dma-sg: Fix buf->vb NULL pointer dereference
Commit a4b83deb3e ("media: videobuf2: rework vb2_mem_ops API")
added a new vb member to struct vb2_dma_sg_buf, but it only added
code setting this to the vb2_dma_sg_alloc() function and not to the
vb2_dma_sg_get_userptr() and vb2_dma_sg_attach_dmabuf() which also
create vb2_dma_sg_buf objects.

This is causing a crash due to a NULL pointer deref when using
libcamera on devices with an Intel IPU3 (qcam app).

Fix these crashes by assigning buf->vb in the other 2 functions too,
note libcamera tests the vb2_dma_sg_get_userptr() path, the change
to the vb2_dma_sg_attach_dmabuf() path is untested.

Fixes: a4b83deb3e ("media: videobuf2: rework vb2_mem_ops API")
Cc: Sergey Senozhatsky <senozhatsky@chromium.org>
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
2021-11-10 11:38:48 +00:00
..
b2c2 media: flexcop: avoid -Wempty-body warning 2021-04-09 13:05:01 +02:00
saa7146 media: saa7146: use sg_dma_len when building pgtable 2021-03-11 11:59:44 +01:00
siano media: siano: use DEFINE_MUTEX() for mutex lock 2021-09-30 10:07:43 +02:00
v4l2-tpg treewide: Use fallthrough pseudo-keyword 2020-08-23 17:36:59 -05:00
videobuf2 media: videobuf2-dma-sg: Fix buf->vb NULL pointer dereference 2021-11-10 11:38:48 +00:00
btcx-risc.h
cx2341x.c media: Rename stateful codec control macros 2020-12-03 12:27:32 +01:00
cypress_firmware.c treewide: Add SPDX license identifier for more missed files 2019-05-21 10:50:45 +02:00
cypress_firmware.h
Kconfig media: move ttpci-eeprom to common 2021-06-02 11:16:15 +02:00
Makefile media: move ttpci-eeprom to common 2021-06-02 11:16:15 +02:00
ttpci-eeprom.c media: move ttpci-eeprom to common 2021-06-02 11:16:15 +02:00
ttpci-eeprom.h media: move ttpci-eeprom to common 2021-06-02 11:16:15 +02:00
tveeprom.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 157 2019-05-30 11:26:37 -07:00