mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-11 23:24:22 -04:00
BACKPORT: media: venus: hfi: fix the check in 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.
cherry picked from b18e36dfd6c9 ("media: venus: hfi: fix the check to
handle session buffer requirement").
Change-Id: I8169c57b2c244c52bac0b4de460b9820707f6ff7
Cc: stable@vger.kernel.org
Fixes: 09c2845e8f ("[media] media: venus: hfi: add Host Firmware Interface (HFI)")
Reviewed-by: Nathan Hebert <nhebert@chromium.org>
Signed-off-by: Stanimir Varbanov <stanimir.k.varbanov@gmail.com>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: Vikash Garodia <quic_vgarodia@quicinc.com>
(cherry picked from commit 8346a4a3b40d2075635723f537952a8e27dfc949)
This commit is contained in:
parent
e2907c28b1
commit
b375ca6675
1 changed files with 1 additions and 1 deletions
|
|
@ -350,7 +350,7 @@ session_get_prop_buf_req(struct hfi_msg_session_property_info_pkt *pkt,
|
|||
memcpy(&bufreq[idx], buf_req, sizeof(*bufreq));
|
||||
idx++;
|
||||
|
||||
if (idx > HFI_BUFFER_TYPE_MAX)
|
||||
if (idx >= HFI_BUFFER_TYPE_MAX)
|
||||
return HFI_ERR_SESSION_INVALID_PARAMETER;
|
||||
|
||||
req_bytes -= sizeof(struct hfi_buffer_requirements);
|
||||
|
|
|
|||
Loading…
Reference in a new issue