From: sashiko-bot@kernel.org
To: "Bilal Hashim" <AeeSec@126.com>
Cc: dri-devel@lists.freedesktop.org, ojeda@kernel.org, gary@garyguo.net
Subject: Re: [PATCH] drm/tyr: fw: fix integer overflow and inverted range check in Cursor
Date: Fri, 27 Nov 2026 12:45:57 +0000 [thread overview]
Message-ID: <sashiko-outbox-237428@kernel.org> (raw)
In-Reply-To: <20261127124107.1782-1-AeeSec@126.com>
Thank you for your contribution! Sashiko AI review found 1 potential
issue to consider:
- [Low] drm/tyr: missing Fixes trailer for Cursor bounds and overflow
fix
--
commit b90a1dd0329f798d9b7953db9ea5076afe11d6da
Author: Bilal Hashim <AeeSec@126.com>
> drm/tyr: fw: fix integer overflow and inverted range check in Cursor
>
> In drivers/gpu/drm/tyr/fw/parser.rs, the firmware binary parser `Cursor`
> has two bounds-checking bugs that can panic the kernel on malformed
> firmware images:
>
> 1. `Cursor::view()` checks `range.start < self.pos || range.end >
> self.data.len()`, but does not check `range.start > range.end`. An
> inverted range passes the check and panics when indexing
> `&self.data[range]`.
> 2. `Cursor::read()` and `Cursor::advance()` compute `self.pos + nbytes`
> without overflow checking. On 32-bit systems (or with large `nbytes`),
> the addition can wrap around to a value less than `self.data.len()`,
> bypassing the bounds check and panicking in `&self.data[start..end]`
> or corrupting `self.pos`.
>
> Use `checked_add()` in `read()` and `advance()`, and reject inverted
> ranges (`range.start > range.end`) in `view()`.
>
> Signed-off-by: Bilal Hashim <AeeSec@126.com>
[Severity: Low]
This fixes bounds-checking bugs in Cursor::view(), Cursor::read(), and
Cursor::advance(). Should the commit message include a Fixes tag?
Fixes: aa9ce8201360 ("drm/tyr: add parser for firmware binary")
--
Sashiko AI review · https://sashiko.dev/#/patchset/20261127124107.1782-1-AeeSec@126.com?part=1
next prev parent reply other threads:[~2026-11-27 12:46 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-27 12:41 [PATCH] drm/tyr: fw: fix integer overflow and inverted range check in Cursor Bilal Hashim
2026-11-27 12:45 ` sashiko-bot [this message]
2026-11-27 17:15 ` Alice Ryhl
2026-11-28 2:01 ` [PATCH v2] drm/tyr: fw: harden Cursor bounds checks Bilal Hashim
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-237428@kernel.org \
--to=sashiko-bot@kernel.org \
--cc=AeeSec@126.com \
--cc=dri-devel@lists.freedesktop.org \
--cc=gary@garyguo.net \
--cc=ojeda@kernel.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.