]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
media: venus: hfi_parser: add check to avoid out of bound access
authorVikash Garodia <quic_vgarodia@quicinc.com>
Thu, 20 Feb 2025 17:20:08 +0000 (22:50 +0530)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 25 Apr 2025 08:45:24 +0000 (10:45 +0200)
commitd4d88ece4ba91df5b02f1d3f599650f9e9fc0f45
tree4c6596a295982e53fd6b31f3065719e201c6d7db
parent28bdf7b9140ae141b0a9d31c3ce9dd6f0944a66a
media: venus: hfi_parser: add check to avoid out of bound access

commit 172bf5a9ef70a399bb227809db78442dc01d9e48 upstream.

There is a possibility that init_codecs is invoked multiple times during
manipulated payload from video firmware. In such case, if codecs_count
can get incremented to value more than MAX_CODEC_NUM, there can be OOB
access. Reset the count so that it always starts from beginning.

Cc: stable@vger.kernel.org
Fixes: 1a73374a04e5 ("media: venus: hfi_parser: add common capability parser")
Reviewed-by: Bryan O'Donoghue <bryan.odonoghue@linaro.org>
Signed-off-by: Vikash Garodia <quic_vgarodia@quicinc.com>
Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/media/platform/qcom/venus/hfi_parser.c