[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <2025051543-override-rockiness-3ead@gregkh>
Date: Thu, 15 May 2025 09:38:55 +0200
From: Greg KH <gregkh@...uxfoundation.org>
To: Alexandre Courbot <acourbot@...dia.com>
Cc: Miguel Ojeda <ojeda@...nel.org>, Alex Gaynor <alex.gaynor@...il.com>,
Boqun Feng <boqun.feng@...il.com>, Gary Guo <gary@...yguo.net>,
Björn Roy Baron <bjorn3_gh@...tonmail.com>,
Benno Lossin <benno.lossin@...ton.me>,
Andreas Hindborg <a.hindborg@...nel.org>,
Alice Ryhl <aliceryhl@...gle.com>, Trevor Gross <tmgross@...ch.edu>,
Danilo Krummrich <dakr@...nel.org>, linux-kernel@...r.kernel.org,
rust-for-linux@...r.kernel.org
Subject: Re: [PATCH] rust: add basic ELF sections parser
On Thu, May 15, 2025 at 03:03:51PM +0900, Alexandre Courbot wrote:
> Add a simple ELF sections parser for unpacking loaded binaries from
> user-space. This is not intended to become a fully-fledged ELF parser,
> just a helper to parse firmwares packaged in that format.
>
> This parser is notably helpful for NVIDIA's GSP firmware, which is
> provided as an ELF binary using sections to separate the firmware code
> to its other components like chipset-specific signatures.
>
> Since the data source is likely to be user-space, checked arithmetic
> operations and strict bound checking are used.
>
> Signed-off-by: Alexandre Courbot <acourbot@...dia.com>
> ---
> This will soon be needed in order to load the GSP firmware in nova-core,
> so sending this early for separate review.
> ---
> rust/kernel/elf.rs | 322 +++++++++++++++++++++++++++++++++++++++++++++++++++++
Why is this not just done in userspace and then have userspace feed the
proper elf sections to the kernel through the firmware interface?
Having to parse elf seems crazy for the kernel to be forced to do here
as the kernel should NOT be touching anything in a firmware blob other
than passing it off to the firmware directly.
thanks,
greg k-h
Powered by blists - more mailing lists