mirror of
https://mirrors.bfsu.edu.cn/git/linux.git
synced 2024-12-16 15:34:48 +08:00
media: venus: hfi: fix the check to handle session buffer requirement
commitb18e36dfd6
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:09c2845e8f
("[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>
This commit is contained in:
parent
47b12dc269
commit
db6bd47243
@ -398,7 +398,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 New Issue
Block a user