mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Daniel Almeida <daniel.almeida@collabora.com>
To: dakr@kernel.org, simona@ffwll.ch, airlied@gmail.com,
	 aliceryhl@google.com
Cc: Sami Tolvanen <samitolvanen@google.com>,
	 dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org,
	 rust-for-linux@vger.kernel.org,
	 Daniel Almeida <daniel.almeida@collabora.com>
Subject: [PATCH RESEND 0/3] drm/tyr: KUnit tests and fixes for the firmware parser
Date: Fri, 27 Nov 2026 15:01:36 -0300	[thread overview]
Message-ID: <20261127-tyr-fw-parser-v1-0-8aab2a711f9b@collabora.com> (raw)

Tyr's firmware parser has no tests at all. Assuming well-formed files in
linux-firmware, it means that the error paths in the parser are not
tested. This is a bad combination for code that directly consumes
userspace data.

Patch 1 adds a KUnit suite for it. The suite builds a well-formed image
from named fields and checks that malformed images are rejected. This
suite obviously can't cover every corner case, but at least it can be
progressively expanded.

The parser also accepted two kinds of malformed images, so the gap is
closed by patches 2 and 3. Patch 2 rejects sections whose VA ranges
overlap, and patch 3 rejects section data that is larger than its VA
range. Each adds the test that fails without it. Sami Tolvanen had
already fixed both of these issues downstream.

This is based on drm-rust-next. Tested with KUnit on arm64 under QEMU,
and with IGT on an RK3588 board.

---
Daniel Almeida (3):
      drm/tyr: add KUnit tests for the firmware parser
      drm/tyr: reject firmware sections that overlap
      drm/tyr: reject firmware sections with oversized data

 drivers/gpu/drm/tyr/fw/parser.rs | 379 +++++++++++++++++++++++++++++++++++++++
 1 file changed, 379 insertions(+)
---
base-commit: abfb640b2374e26de8ff81d488c39d8254db538e
change-id: 20261125-tyr-fw-parser-073e351dc7b6

Best regards,
--
Daniel Almeida <daniel.almeida@collabora.com>
-- 
Daniel Almeida <daniel.almeida@collabora.com>


             reply	other threads:[~2026-11-27 18:02 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-27 18:01 Daniel Almeida [this message]
2026-11-27 18:01 ` [PATCH RESEND 1/3] drm/tyr: add KUnit tests " Daniel Almeida
2026-11-27 18:01 ` [PATCH RESEND 2/3] drm/tyr: reject firmware sections that overlap Daniel Almeida
2026-11-27 18:01 ` [PATCH RESEND 3/3] drm/tyr: reject firmware sections with oversized data Daniel Almeida
2026-11-27 19:40 ` [PATCH RESEND 0/3] drm/tyr: KUnit tests and fixes for the firmware parser Daniel Almeida

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=20261127-tyr-fw-parser-v1-0-8aab2a711f9b@collabora.com \
    --to=daniel.almeida@collabora.com \
    --cc=airlied@gmail.com \
    --cc=aliceryhl@google.com \
    --cc=dakr@kernel.org \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=rust-for-linux@vger.kernel.org \
    --cc=samitolvanen@google.com \
    --cc=simona@ffwll.ch \
    /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®