From: sashiko-bot@kernel.org
To: "Arun Iyengar" <aiyengar1990@gmail.com>
Cc: linux-sunxi@lists.linux.dev, media-ci@linuxtv.org
Subject: Re: [PATCH 4/5] media: staging: cedrus: h265: fail the job when the bit reader times out
Date: Tue, 01 Dec 2026 15:33:10 +0000 [thread overview]
Message-ID: <sashiko-outbox-243576@kernel.org> (raw)
In-Reply-To: <20261201-b4-cedrus-bitreader-v1-4-678ded51faf1@gmail.com>
Thank you for your contribution! Sashiko AI review found no new issues
in this patch, but noticed 1 related pre-existing issue it does not
introduce:
- [Critical] media: cedrus: division by zero in cedrus_h265_setup() [1]
--
commit 4d686e15cd9c521f9969e8cadebfff0d3d9d3130
Author: Arun Iyengar <aiyengar1990@gmail.com>
media: staging: cedrus: h265: fail the job when the bit reader times out
This commit returns -ETIMEDOUT from cedrus_h265_skip_bits() and
cedrus_h265_show_bits() and propagates the error in cedrus_h265_setup() to
fail the decode job when the hardware bit reader times out.
Link: https://lore.kernel.org/all/20220914150105.209484-1-dmitry.osipenko@collabora.com/ [1]
Link: https://lore.kernel.org/all/1733932.VLH7GnMWUR@kista/ [2]
> diff --git a/drivers/staging/media/sunxi/cedrus/cedrus_h265.c b/drivers/staging/media/sunxi/cedrus/cedrus_h265.c
> index 44539936b550b..a00d7bc705c3d 100644
> --- a/drivers/staging/media/sunxi/cedrus/cedrus_h265.c
> +++ b/drivers/staging/media/sunxi/cedrus/cedrus_h265.c
[ ... ]
> @@ -433,8 +442,10 @@ static int cedrus_h265_setup(struct cedrus_ctx *ctx, struct cedrus_run *run)
> u32 pic_order_cnt[2];
> size_t slice_bytes;
> u8 padding;
> + u32 bits;
> int count;
> u32 reg;
> + int ret;
>
> sps = run->h265.sps;
> pps = run->h265.pps;
[Severity: Critical]
This problem wasn't introduced by this patch, but can cedrus_h265_setup()
divide by zero [1] when sps->pic_width_in_luma_samples is 0?
Neither cedrus_try_ctrl() nor cedrus_check_pic_size() rejects a
V4L2_CID_STATELESS_HEVC_SPS control with pic_width_in_luma_samples set to
0. When cedrus_h265_setup() runs, width_in_ctb_luma evaluates to 0 and is
used as the divisor when computing ctb_addr_x and ctb_addr_y:
drivers/staging/media/sunxi/cedrus/cedrus_h265.c:cedrus_h265_setup() {
...
width_in_ctb_luma =
DIV_ROUND_UP(sps->pic_width_in_luma_samples, ctb_size_luma);
...
ctb_addr_x = slice_params->slice_segment_addr % width_in_ctb_luma;
ctb_addr_y = slice_params->slice_segment_addr / width_in_ctb_luma;
...
}
This triggers a kernel division-by-zero oops.
[1] https://sashiko.dev/#/bug/linux-178e76f9-5ffb-448a-b528-5cd7caf9d21d
--
Sashiko AI review · https://sashiko.dev/#/patchset/20261201-b4-cedrus-bitreader-v1-0-678ded51faf1@gmail.com?part=4
next prev parent reply other threads:[~2026-12-01 15:33 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-12-01 15:26 [PATCH 0/5] media: staging: cedrus: bound and check the bit reader setup Arun Iyengar via B4 Relay
2026-12-01 15:26 ` [PATCH 1/5] media: staging: cedrus: h264: bound the wait for the bit skip Arun Iyengar via B4 Relay
2026-12-01 15:26 ` [PATCH 2/5] media: staging: cedrus: h264: reject a slice header larger than the slice Arun Iyengar via B4 Relay
2026-12-01 15:26 ` [PATCH 3/5] media: staging: cedrus: h265: reject a slice data offset past " Arun Iyengar via B4 Relay
2026-12-01 15:27 ` [PATCH 4/5] media: staging: cedrus: h265: fail the job when the bit reader times out Arun Iyengar via B4 Relay
2026-12-01 15:33 ` sashiko-bot [this message]
2026-12-01 15:27 ` [PATCH 5/5] media: staging: cedrus: vp8: fail the job on a bit reader timeout Arun Iyengar via B4 Relay
2026-12-01 15:40 ` sashiko-bot
2026-12-01 16:07 ` [PATCH 0/5] media: staging: cedrus: bound and check the bit reader setup Jernej Škrabec
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=sashiko-outbox-243576@kernel.org \
--to=sashiko-bot@kernel.org \
--cc=aiyengar1990@gmail.com \
--cc=linux-sunxi@lists.linux.dev \
--cc=media-ci@linuxtv.org \
--cc=sashiko-reviews@lists.linux.dev \
/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