From: Konrad Dybcio <konrad.dybcio@linaro.org>
To: Vikash Garodia <quic_vgarodia@quicinc.com>,
stanimir.k.varbanov@gmail.com, bryan.odonoghue@linaro.org,
agross@kernel.org, andersson@kernel.org, mchehab@kernel.org,
hans.verkuil@cisco.com, tfiga@chromium.org
Cc: linux-media@vger.kernel.org, linux-arm-msm@vger.kernel.org,
linux-kernel@vger.kernel.org, stable@vger.kernel.org
Subject: Re: [PATCH 4/4] venus: hfi_parser: Add check to keep the number of codecs within range
Date: Thu, 27 Jul 2023 19:11:21 +0200 [thread overview]
Message-ID: <d146e175-bbc2-3f25-9b97-49c9c402357c@linaro.org> (raw)
In-Reply-To: <1690432469-14803-5-git-send-email-quic_vgarodia@quicinc.com>
On 27.07.2023 06:34, Vikash Garodia wrote:
> Supported codec bitmask is populated from the payload from venus firmware.
> There is a possible case when all the bits in the codec bitmask is set. In
> such case, core cap for decoder is filled and MAX_CODEC_NUM is utilized.
> Now while filling the caps for encoder, it can lead to access the caps
> array beyong 32 index. Hence leading to OOB write.
> The fix counts the supported encoder and decoder. If the count is more than
> max, then it skips accessing the caps.
>
> Cc: stable@vger.kernel.org
> Fixes: 1a73374a04e5 ("media: venus: hfi_parser: add common capability parser")
> Signed-off-by: Vikash Garodia <quic_vgarodia@quicinc.com>
> ---
> drivers/media/platform/qcom/venus/hfi_parser.c | 15 +++++++++++++++
> 1 file changed, 15 insertions(+)
>
> diff --git a/drivers/media/platform/qcom/venus/hfi_parser.c b/drivers/media/platform/qcom/venus/hfi_parser.c
> index ec73cac..651e215 100644
> --- a/drivers/media/platform/qcom/venus/hfi_parser.c
> +++ b/drivers/media/platform/qcom/venus/hfi_parser.c
> @@ -14,11 +14,26 @@
> typedef void (*func)(struct hfi_plat_caps *cap, const void *data,
> unsigned int size);
>
> +static int count_setbits(u32 input)
hweight_long()?
Konrad
prev parent reply other threads:[~2023-07-27 17:11 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-07-27 4:34 [PATCH 0/4] Venus driver fixes to avoid possible OOB accesses Vikash Garodia
2023-07-27 4:34 ` [PATCH 1/4] venus: hfi: add checks to perform sanity on queue pointers Vikash Garodia
2023-07-27 17:08 ` Konrad Dybcio
2023-07-28 7:56 ` Vikash Garodia
2023-07-27 4:34 ` [PATCH 2/4] venus: hfi: fix the check to handle session buffer requirement Vikash Garodia
2023-07-28 19:12 ` Nathan Hebert
2023-07-27 4:34 ` [PATCH 3/4] venus: hfi: add checks to handle capabilities from firmware Vikash Garodia
2023-07-28 21:14 ` Nathan Hebert
2023-07-27 4:34 ` [PATCH 4/4] venus: hfi_parser: Add check to keep the number of codecs within range Vikash Garodia
2023-07-27 17:11 ` Konrad Dybcio [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=d146e175-bbc2-3f25-9b97-49c9c402357c@linaro.org \
--to=konrad.dybcio@linaro.org \
--cc=agross@kernel.org \
--cc=andersson@kernel.org \
--cc=bryan.odonoghue@linaro.org \
--cc=hans.verkuil@cisco.com \
--cc=linux-arm-msm@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-media@vger.kernel.org \
--cc=mchehab@kernel.org \
--cc=quic_vgarodia@quicinc.com \
--cc=stable@vger.kernel.org \
--cc=stanimir.k.varbanov@gmail.com \
--cc=tfiga@chromium.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®