media: venus: hfi: fix the check to handle session buffer requirement
authorVikash Garodia <quic_vgarodia@quicinc.com>
Thu, 10 Aug 2023 02:25:02 +0000 (07:55 +0530)
committerHans Verkuil <hverkuil-cisco@xs4all.nl>
Mon, 23 Oct 2023 10:24:52 +0000 (12:24 +0200)
commitb18e36dfd6c935da60a971310374f3dfec3c82e1
tree0cc6f9cb5b1c1908699b6ba08216064dc2ce14a2
parent5e538fce33589da6d7cb2de1445b84d3a8a692f7
media: venus: hfi: fix the check to handle session buffer requirement

Buffer requirement, for different buffer type, comes from video firmware.
While copying these requirements, there is an OOB possibility when the
payload from firmware is more than expected size. Fix the check to avoid
the OOB possibility.

Cc: stable@vger.kernel.org
Fixes: 09c2845e8fe4 ("[media] media: venus: hfi: add Host Firmware Interface (HFI)")
Reviewed-by: Nathan Hebert <nhebert@chromium.org>
Signed-off-by: Vikash Garodia <quic_vgarodia@quicinc.com>
Signed-off-by: Stanimir Varbanov <stanimir.k.varbanov@gmail.com>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
drivers/media/platform/qcom/venus/hfi_msgs.c