Commit 1827b85a authored by Gaviraju Doddabettahalli Bettegowda's avatar Gaviraju Doddabettahalli Bettegowda Committed by Treehugger Robot
Browse files

FROMGIT: media: venus: Fix OOB read due to missing payload bound check



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.

Signed-off-by: default avatarVedang Nagar <quic_vnagar@quicinc.com>
Reviewed-by: default avatarVikash Garodia <quic_vgarodia@quicinc.com>
Reviewed-by: default avatarBryan O'Donoghue <bryan.odonoghue@linaro.org>
Co-developed-by: default avatarDikshita Agarwal <quic_dikshita@quicinc.com>
Signed-off-by: default avatarDikshita Agarwal <quic_dikshita@quicinc.com>
Signed-off-by: default avatarBryan O'Donoghue <bod@kernel.org>
Signed-off-by: default avatarHans Verkuil <hverkuil@xs4all.nl>

(cherry picked from commit 06d6770f https://gitlab.freedesktop.org/linux-media/media-committers.git

 master)
Change-Id: If1e48a3e439a1b0bf0c21860654dc08110f0fbbf
Signed-off-by: default avatarGaviraju Doddabettahalli Bettegowda <quic_gdoddabe@quicinc.com>
parent 2888255b
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment