From: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
To: "Ágatha Isabelle Chris Moreira Guedes" <code@agatha.dev>
Cc: "Luis Chamberlain" <mcgrof@kernel.org>,
linux-staging@lists.linux.dev, linux-kernel@vger.kernel.org,
linux-modules@vger.kernel.org,
"Uwe Kleine-König" <u.kleine-koenig@baylibre.com>,
"Dan Carpenter" <dan.carpenter@linaro.org>,
patch-reply@agatha.dev
Subject: Re: [PATCH v3] init: staging: Fix missing warning/taint on builtin code
Date: Wed, 10 Jul 2024 15:22:22 +0200 [thread overview]
Message-ID: <2024071032-hardened-discard-4cf6@gregkh> (raw)
In-Reply-To: <zsk54zosv6tht4j4nma4ix7lq2knxi3ylqadd2foznc72nkaa3@xbc7gpozx6ai>
On Sat, Jul 06, 2024 at 12:15:01AM -0300, Ágatha Isabelle Chris Moreira Guedes wrote:
> Fix the absence of warning message and kernel tainting when initializing
> drivers from the `drivers/staging` subtree from initcalls (when
> configured as built-in).
>
> When such a driver is built as module and the module is loaded, the
> `load_module()` function taints the kernel to signal code of unknown
> quality is loaded, and produces a warning like this:
>
> [ 8.076352] rts5208: module is from the staging directory, the
> quality is unknown, you have been warned.
>
> The same behaviour is absent, however, when a staging driver is compiled
> as built-in on the kernel image, since loading it happens through
> initcalls and not through load_module().
>
> This might prevent relevant information of being available on a bug
> report (i.e. on a panic log) among other possible problems.
>
> NOTES:
> - The patch is written in such a way that all non-staging drivers are
> kept the way they were, except for staging drivers built with
> `-DSTAGING_CODE`.
That's good!
> - Since it changes some macros related to clang LTO as well, I tested it
> and it works properly in kernels compiled with both clang and gcc.
This is odd, why is it messing with LTO stuff? It should be much more
"self contained" than this I feel like.
I see what you are doing by trying to use some of the LTO macros again,
but in doing so, it makes it really hard to understand the diff and feel
comfortable with this.
If you want to stick with what you have done here, can you split it up a
bit more? Once patch for the LTO header file changes and then another
that only adds the staging stuff. That way it's easier to review and
justify that nothing is going to be broken with this patch.
> - Some `checkpatch.pl` errors, warnings and checks (with `--strict`) are
> present. Some were already there, some I introduced but I think
> they're unavoidable. Some IMHO don´t make sense at all, I think they
> would apply for most regular macros but initcall macros are just way
> different.
Yeah, checkpatch and macros can get tricky, use your best judgement here
and it looks ok.
> Fixes: 061b1bd394ca ("Staging: add TAINT_CRAP for all drivers/staging code")
I think it really fixes the commit _after_ this one that turns on the
taint for the build :)
anyway, nice work, I think it's almost there!
greg k-h
prev parent reply other threads:[~2024-07-10 13:22 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-07-06 3:15 [PATCH v3] init: staging: Fix missing warning/taint on builtin code Ágatha Isabelle Chris Moreira Guedes
2024-07-08 15:41 ` Dan Carpenter
2024-07-09 6:58 ` Uwe Kleine-König
2024-07-10 13:22 ` Greg Kroah-Hartman [this message]
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=2024071032-hardened-discard-4cf6@gregkh \
--to=gregkh@linuxfoundation.org \
--cc=code@agatha.dev \
--cc=dan.carpenter@linaro.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-modules@vger.kernel.org \
--cc=linux-staging@lists.linux.dev \
--cc=mcgrof@kernel.org \
--cc=patch-reply@agatha.dev \
--cc=u.kleine-koenig@baylibre.com \
/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