linux/drivers/media
Vedang Nagar a3eef58476 media: venus: Fix OOB read due to missing payload bound check
[ Upstream commit 06d6770ff0 ]

Currently, The event_seq_changed() handler processes a variable number
of properties sent by the firmware. The number of properties is indicated
by the firmware and used to iterate over the payload. However, the
payload size is not being validated against the actual message length.

This can lead to out-of-bounds memory access if the firmware provides a
property count that exceeds the data available in the payload. Such a
condition can result in kernel crashes or potential information leaks if
memory beyond the buffer is accessed.

Fix this by properly validating the remaining size of the payload before
each property access and updating bounds accordingly as properties are
parsed.

This ensures that property parsing is safely bounded within the received
message buffer and protects against malformed or malicious firmware
behavior.

Fixes: 09c2845e8f ("[media] media: venus: hfi: add Host Firmware Interface (HFI)")
Cc: stable@vger.kernel.org
Signed-off-by: Vedang Nagar <quic_vnagar@quicinc.com>
Reviewed-by: Vikash Garodia <quic_vgarodia@quicinc.com>
Reviewed-by: Bryan O'Donoghue <bryan.odonoghue@linaro.org>
Co-developed-by: Dikshita Agarwal <quic_dikshita@quicinc.com>
Signed-off-by: Dikshita Agarwal <quic_dikshita@quicinc.com>
Signed-off-by: Bryan O'Donoghue <bod@kernel.org>
Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
Signed-off-by: Sasha Levin <sashal@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
History 2025-08-28 16:26:11 +02:00
..
cec media: rainshadow-cec: fix TOCTOU race condition in rain_interrupt() 2025-08-28 16:26:08 +02:00
common media: videobuf2: use sgtable-based scatterlist wrappers 2025-06-27 11:07:27 +01:00
dvb-core media: dvbdev: fix the logic when DVB_DYNAMIC_MINORS is not set 2024-11-22 15:37:32 +01:00
dvb-frontends media: dvb-frontends: w7090p: fix null-ptr-deref in w7090p_tuner_write_serpar and w7090p_tuner_read_serpar 2025-08-28 16:26:01 +02:00
firewire media: Makefiles: remove extra spaces 2022-03-12 16:59:52 +01:00
i2c media: ov2659: Fix memory leaks in ov2659_probe() 2025-08-28 16:26:08 +02:00
mc media: mc: mark the media devnode as registered from the, start 2024-06-16 13:41:35 +02:00
mmc media: media/*/Kconfig: sort entries 2022-03-18 05:58:35 +01:00
pci media: solo6x10: replace max(a, min(b, c)) by clamp(b, a, c) 2024-08-29 17:30:41 +02:00
platform media: venus: Fix OOB read due to missing payload bound check 2025-08-28 16:26:11 +02:00
radio media: wl128x: Fix atomicity violation in fmc_send_cmd() 2024-12-14 19:54:04 +01:00
rc media: streamzap: prevent processing IR data on URB failure 2025-04-25 10:43:37 +02:00
spi media updates for v5.18-rc1 2022-03-23 14:51:35 -07:00
test-drivers media: vivid: fix wrong pixel_array control size 2025-08-28 16:26:08 +02:00
tuners Revert "media: tuners: fix error return code of hybrid_tuner_request_state()" 2024-10-17 15:21:16 +02:00
usb media: usbtv: Lock resolution while streaming 2025-08-28 16:26:08 +02:00
v4l2-core media: v4l2-ctrls: Don't reset handler's error in v4l2_ctrl_handler_free() 2025-08-28 16:26:08 +02:00
Kconfig media: remove reference to CONFIG_EMBEDDED in MEDIA_SUPPORT_FILTER 2022-09-08 18:19:29 +02:00
Makefile media: Makefiles: remove extra spaces 2022-03-12 16:59:52 +01:00