]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
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)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 28 Nov 2023 16:45:45 +0000 (16:45 +0000)
commitf4743a0cb3cc440ae1b2129b3c71e8bd56436708
tree49132760fb15910e5e1e47af2005092e0688c6f0
parent455c8a996a832e19a4cced4575eaf751ed00cdfe
media: venus: hfi: fix the check to handle session buffer requirement

commit b18e36dfd6c935da60a971310374f3dfec3c82e1 upstream.

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>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/media/platform/qcom/venus/hfi_msgs.c