From: Vikash Garodia <vikash.garodia@oss.qualcomm.com>
To: Vishnu Reddy <busanna.reddy@oss.qualcomm.com>,
Dikshita Agarwal <dikshita.agarwal@oss.qualcomm.com>,
Abhinav Kumar <abhinav.kumar@linux.dev>,
Bryan O'Donoghue <bod@kernel.org>,
Mauro Carvalho Chehab <mchehab@kernel.org>,
Hans Verkuil <hverkuil@kernel.org>,
Stefan Schmidt <stefan.schmidt@linaro.org>
Cc: linux-media@vger.kernel.org, linux-arm-msm@vger.kernel.org,
linux-kernel@vger.kernel.org, stable@vger.kernel.org,
Birk Skyum <birk.skyum@pm.me>,
Deepa Madivalara <deepa.madivalara@oss.qualcomm.com>
Subject: Re: [PATCH v2] media: iris: Fix out-of-bounds read in timestamp metadata fallback
Date: Fri, 27 Nov 2026 18:02:49 +0530 [thread overview]
Message-ID: <576033e7-e52a-4ad6-a594-d64b3fe9987f@oss.qualcomm.com> (raw)
In-Reply-To: <20261117-fix-oob-tss-v2-1-8bbf753a4ee0@oss.qualcomm.com>
On 11/17/2026 5:13 PM, Vishnu Reddy wrote:
> inst->tss[] has VIDEO_MAX_FRAME (32) entries, so valid indexes are 0
> through 31. iris_set_ts_metadata() writes at metadata_idx and then
> increments it, wrapping only on the next call. After the 32nd input
> buffer, metadata_idx is 32 until the next input buffer is queued.
>
> If iris_get_ts_metadata() finds no matching timestamp in that window,
> its fallback reads inst->tss[32], one entry past the end of the array.
> UBSAN reports this as an array-index-out-of-bounds error.
>
> Advance metadata_idx before the write instead, starting from the last
> slot so the first write still lands in slot 0. The index then always
> refers to the last written entry and is never out of range, so the
> fallback read needs no special handling.
>
> Fixes: 17f2a485ca67 ("media: iris: implement vb2 ops for buf_queue and firmware response")
> Cc:stable@vger.kernel.org
> Tested-by: Birk Skyum<birk.skyum@pm.me> # Lenovo Yoga Slim 7x (X1E80100)
> Tested-by: Deepa Madivalara<deepa.madivalara@oss.qualcomm.com>
> Signed-off-by: Vishnu Reddy<busanna.reddy@oss.qualcomm.com>
> ---
> Changes in v2:
> - Wrap metadata_idx in iris_set_ts_metadata() instead of fixing the fallback read (Bryan)
> - Link to v1:https://patch.msgid.link/20261017-fix-oob-tss-v1-1-
> fb86f4cabf65@oss.qualcomm.com
> ---
> drivers/media/platform/qcom/iris/iris_common.c | 4 ++--
> drivers/media/platform/qcom/iris/iris_vidc.c | 1 +
> 2 files changed, 3 insertions(+), 2 deletions(-)
Reviewed-by: Vikash Garodia <vikash.garodia@oss.qualcomm.com>
prev parent reply other threads:[~2026-11-27 12:32 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-17 11:43 Vishnu Reddy
2026-11-27 12:32 ` Vikash Garodia [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=576033e7-e52a-4ad6-a594-d64b3fe9987f@oss.qualcomm.com \
--to=vikash.garodia@oss.qualcomm.com \
--cc=abhinav.kumar@linux.dev \
--cc=birk.skyum@pm.me \
--cc=bod@kernel.org \
--cc=busanna.reddy@oss.qualcomm.com \
--cc=deepa.madivalara@oss.qualcomm.com \
--cc=dikshita.agarwal@oss.qualcomm.com \
--cc=hverkuil@kernel.org \
--cc=linux-arm-msm@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-media@vger.kernel.org \
--cc=mchehab@kernel.org \
--cc=stable@vger.kernel.org \
--cc=stefan.schmidt@linaro.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®