]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
media: venus: Add a check for packet size after reading from shared memory
authorVedang Nagar <quic_vnagar@quicinc.com>
Mon, 19 May 2025 07:12:21 +0000 (12:42 +0530)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 28 Aug 2025 14:24:29 +0000 (16:24 +0200)
commitef09b96665f16f3f0bac4e111160e6f24f1f8791
treef33e5764fb1705a87a29d5fab63336addc279492
parentf16dc2c87ce4f4841f97a1aa66cb15fa47cccaf6
media: venus: Add a check for packet size after reading from shared memory

commit 49befc830daa743e051a65468c05c2ff9e8580e6 upstream.

Add a check to ensure that the packet size does not exceed the number of
available words after reading the packet header from shared memory. This
ensures that the size provided by the firmware is safe to process and
prevent potential out-of-bounds memory access.

Fixes: d96d3f30c0f2 ("[media] media: venus: hfi: add Venus HFI files")
Cc: stable@vger.kernel.org
Signed-off-by: Vedang Nagar <quic_vnagar@quicinc.com>
Co-developed-by: Dikshita Agarwal <quic_dikshita@quicinc.com>
Signed-off-by: Dikshita Agarwal <quic_dikshita@quicinc.com>
Reviewed-by: Bryan O'Donoghue <bryan.odonoghue@linaro.org>
Signed-off-by: Bryan O'Donoghue <bod@kernel.org>
Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/media/platform/qcom/venus/hfi_venus.c