linux-stable/drivers/media
Wei Chen 5cdad9b218 media: vcodec: Fix potential array out-of-bounds in encoder queue_setup
commit e7f2e65699 upstream.

variable *nplanes is provided by user via system call argument. The
possible value of q_data->fmt->num_planes is 1-3, while the value
of *nplanes can be 1-8. The array access by index i can cause array
out-of-bounds.

Fix this bug by checking *nplanes against the array size.

Fixes: 4e855a6efa ("[media] vcodec: mediatek: Add Mediatek V4L2 Video Encoder Driver")
Signed-off-by: Wei Chen <harperchen1110@gmail.com>
Cc: stable@vger.kernel.org
Reviewed-by: Chen-Yu Tsai <wenst@chromium.org>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2023-08-30 16:31:55 +02:00
..
cec media: cec: core: don't set last_initiator if tx in progress 2023-06-28 10:15:31 +02:00
common media: saa7146: hexium_gemini: Fix a NULL pointer dereference in hexium_attach() 2022-01-27 09:04:26 +01:00
dvb-core media: dvb-core: Fix use-after-free due to race condition at dvb_ca_en50221 2023-06-09 10:24:00 +02:00
dvb-frontends treewide: Remove uninitialized_var() usage 2023-08-11 11:45:01 +02:00
firewire media: firewire: firedtv-avc: fix a buffer overflow in avc_ca_pmt() 2021-11-06 13:58:45 +01:00
i2c media: m5mols: fix off-by-one loop termination error 2023-03-22 13:27:10 +01:00
mmc
pci media: netup_unidvb: fix irq init by register it at the end of probe 2023-06-09 10:23:59 +02:00
platform media: vcodec: Fix potential array out-of-bounds in encoder queue_setup 2023-08-30 16:31:55 +02:00
radio media: radio-shark: Add endpoint checks 2023-05-30 12:42:14 +01:00
rc media: rc: gpio-ir-recv: Fix support for wake-up 2023-05-17 11:13:10 +02:00
spi media: cxd2880-spi: fix probe when dvb_attach fails 2019-12-13 08:52:23 +01:00
tuners treewide: Remove uninitialized_var() usage 2023-08-11 11:45:01 +02:00
usb media: usb: siano: Fix warning due to null work_func_t function pointer 2023-08-11 11:45:12 +02:00
v4l2-core media: v4l2-dv-timings.c: fix too strict blanking sanity checks 2022-12-14 11:28:27 +01:00
Kconfig
Makefile
media-device.c media: mc-device.c: fix memleak in media_device_register_entity 2020-10-01 13:14:23 +02:00
media-devnode.c
media-entity.c