From: Luis Chamberlain <mcgrof@kernel.org>
To: Danilo Krummrich <dakr@redhat.com>
Cc: russ.weight@linux.dev, gregkh@linuxfoundation.org,
chrisi.schrefl@gmail.com, linux-kernel@vger.kernel.org,
rust-for-linux@vger.kernel.org, Gary Guo <gary@garyguo.net>
Subject: Re: [PATCH v2 2/2] firmware_loader: fix soundness issue in `request_internal`
Date: Mon, 8 Jul 2024 13:37:51 -0700 [thread overview]
Message-ID: <ZoxOHxHze2ynJS-q@bombadil.infradead.org> (raw)
In-Reply-To: <20240708200724.3203-2-dakr@redhat.com>
On Mon, Jul 08, 2024 at 10:07:21PM +0200, Danilo Krummrich wrote:
> `request_internal` must be called with one of the following function
> pointers: request_firmware(), firmware_request_nowarn(),
> firmware_request_platform() or request_firmware_direct().
>
> The previous `FwFunc` alias did not guarantee this, which is unsound.
>
> In order to fix this up, implement `FwFunc` as new type with a
> corresponding type invariant.
>
> Reported-by: Gary Guo <gary@garyguo.net>
> Closes: https://lore.kernel.org/lkml/20240620143611.7995e0bb@eugeo/
> Signed-off-by: Danilo Krummrich <dakr@redhat.com>
While you're at it, can you go ahead and extend out selftest coverage
for the firmware_loader so we can test Rust too? Could these issues
have been caught with a selftest? If not why not?
Luis
next prev parent reply other threads:[~2024-07-08 20:37 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-07-08 20:07 [PATCH v2 1/2] firmware_loader: annotate doctests as `no_run` Danilo Krummrich
2024-07-08 20:07 ` [PATCH v2 2/2] firmware_loader: fix soundness issue in `request_internal` Danilo Krummrich
2024-07-08 20:37 ` Luis Chamberlain [this message]
2024-07-08 21:07 ` Danilo Krummrich
2024-07-08 22:16 ` Christian Schrefl
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=ZoxOHxHze2ynJS-q@bombadil.infradead.org \
--to=mcgrof@kernel.org \
--cc=chrisi.schrefl@gmail.com \
--cc=dakr@redhat.com \
--cc=gary@garyguo.net \
--cc=gregkh@linuxfoundation.org \
--cc=linux-kernel@vger.kernel.org \
--cc=russ.weight@linux.dev \
--cc=rust-for-linux@vger.kernel.org \
/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;
as well as URLs for NNTP newsgroup(s).