Skip to content
This repository was archived by the owner on Nov 8, 2023. It is now read-only.

Commit b18e36d

Browse files
Vikash-GarodiaHans Verkuil
authored andcommitted
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: [email protected] Fixes: 09c2845 ("[media] media: venus: hfi: add Host Firmware Interface (HFI)") Reviewed-by: Nathan Hebert <[email protected]> Signed-off-by: Vikash Garodia <[email protected]> Signed-off-by: Stanimir Varbanov <[email protected]> Signed-off-by: Hans Verkuil <[email protected]>
1 parent 5e538fc commit b18e36d

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

drivers/media/platform/qcom/venus/hfi_msgs.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -398,7 +398,7 @@ session_get_prop_buf_req(struct hfi_msg_session_property_info_pkt *pkt,
398398
memcpy(&bufreq[idx], buf_req, sizeof(*bufreq));
399399
idx++;
400400

401-
if (idx > HFI_BUFFER_TYPE_MAX)
401+
if (idx >= HFI_BUFFER_TYPE_MAX)
402402
return HFI_ERR_SESSION_INVALID_PARAMETER;
403403

404404
req_bytes -= sizeof(struct hfi_buffer_requirements);

0 commit comments

Comments
 (0)