mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH RESEND 0/3] drm/tyr: KUnit tests and fixes for the firmware parser
@ 2026-11-27 18:01 Daniel Almeida
  2026-11-27 18:01 ` [PATCH RESEND 1/3] drm/tyr: add KUnit tests " Daniel Almeida
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: Daniel Almeida @ 2026-11-27 18:01 UTC (permalink / raw)
  To: dakr, simona, airlied, aliceryhl
  Cc: Sami Tolvanen, dri-devel, linux-kernel, rust-for-linux, Daniel Almeida

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>


^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2026-11-27 19:40 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-11-27 18:01 [PATCH RESEND 0/3] drm/tyr: KUnit tests and fixes for the firmware parser Daniel Almeida
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

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®