public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH v2 0/5] gpu: nova-core: use checked arithmetic for firmware parsing robustness
@ 2026-01-26 20:23 Joel Fernandes
  2026-01-26 20:23 ` [PATCH v2 1/5] gpu: nova-core: use checked arithmetic in FWSEC firmware parsing Joel Fernandes
                   ` (6 more replies)
  0 siblings, 7 replies; 21+ messages in thread
From: Joel Fernandes @ 2026-01-26 20:23 UTC (permalink / raw)
  To: linux-kernel
  Cc: Paul Walmsley, Palmer Dabbelt, Albert Ou, Alexandre Ghiti,
	Miguel Ojeda, Boqun Feng, Gary Guo, Björn Roy Baron,
	Benno Lossin, Andreas Hindborg, Alice Ryhl, Trevor Gross,
	Danilo Krummrich, Alexandre Courbot, John Hubbard,
	Alistair Popple, Timur Tabi, Edwin Peer, Zhi Wang, David Airlie,
	Simona Vetter, Bjorn Helgaas, Alex Gaynor, Dirk Behme, nouveau,
	dri-devel, rust-for-linux, linux-riscv, Joel Fernandes

Changes from v1 to v2:
- Added Reviewed-by tags from Zhi
- Fixed comment formatting nits raised by Dirk/Zhi

This series adds checked arithmetic throughout nova-core's firmware parsing
code to guard rust code against integer overflow from corrupt firmware.

Without checked arithmetic, firmware could cause integer overflow when
computing offsets. The danger is not just wrapping to a huge value (which may
fail validation in other paths), but potentially wrapping to a small plausible
offset that accesses entirely wrong data, causing silent corruption or security
issues.

This series has been rebased on drm-rust-next. If possible, I would like us to
consider merging for the upcoming merge window to avoid future conflicts.
Tested probing with GPU name printed in dmesg on my GA102 (Ampere).

The git tree with all patches can be found at:
git://git.kernel.org/pub/scm/linux/kernel/git/jfern/linux.git (tag: nova-checked-arith-v2-20260126)

Link to v1: https://lore.kernel.org/all/20260124231830.3088323-1-joelagnelf@nvidia.com/

Joel Fernandes (5):
  gpu: nova-core: use checked arithmetic in FWSEC firmware parsing
  gpu: nova-core: use checked arithmetic in Booter signature parsing
  gpu: nova-core: use checked arithmetic in frombytes_at helper
  gpu: nova-core: use checked arithmetic in BinFirmware::data
  gpu: nova-core: use checked arithmetic in RISC-V firmware parsing

 drivers/gpu/nova-core/firmware.rs        |  3 +-
 drivers/gpu/nova-core/firmware/booter.rs | 22 ++++++---
 drivers/gpu/nova-core/firmware/fwsec.rs  | 60 ++++++++++++++----------
 drivers/gpu/nova-core/firmware/riscv.rs  |  6 ++-
 4 files changed, 57 insertions(+), 34 deletions(-)


base-commit: cea7b66a80412e2a5b74627b89ae25f1d0110a4b
--
2.34.1


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

end of thread, other threads:[~2026-02-25  0:59 UTC | newest]

Thread overview: 21+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-01-26 20:23 [PATCH v2 0/5] gpu: nova-core: use checked arithmetic for firmware parsing robustness Joel Fernandes
2026-01-26 20:23 ` [PATCH v2 1/5] gpu: nova-core: use checked arithmetic in FWSEC firmware parsing Joel Fernandes
2026-01-28  7:58   ` Alexandre Courbot
2026-01-28  8:08     ` Alexandre Courbot
2026-01-28 15:30       ` Joel Fernandes
2026-01-28 10:53   ` Danilo Krummrich
2026-01-28 15:14     ` Joel Fernandes
2026-01-29  0:20       ` Danilo Krummrich
2026-01-29  0:36         ` Alexandre Courbot
2026-01-29  0:42           ` Joel Fernandes
2026-01-29  0:58         ` John Hubbard
2026-02-03 22:24           ` Alexandre Courbot
2026-02-04 18:54             ` Miguel Ojeda
2026-02-04 21:08               ` Joel Fernandes
2026-01-26 20:23 ` [PATCH v2 2/5] gpu: nova-core: use checked arithmetic in Booter signature parsing Joel Fernandes
2026-01-26 20:23 ` [PATCH v2 3/5] gpu: nova-core: use checked arithmetic in frombytes_at helper Joel Fernandes
2026-01-26 20:23 ` [PATCH v2 4/5] gpu: nova-core: use checked arithmetic in BinFirmware::data Joel Fernandes
2026-01-26 20:23 ` [PATCH v2 5/5] gpu: nova-core: use checked arithmetic in RISC-V firmware parsing Joel Fernandes
2026-01-27 13:54 ` [PATCH v2 0/5] gpu: nova-core: use checked arithmetic for firmware parsing robustness Gary Guo
2026-01-28  7:59 ` Alexandre Courbot
2026-02-25  0:59   ` Alexandre Courbot

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox