mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Petr Pavlu <petr.pavlu@suse.com>
To: Gary Guo <gary@garyguo.net>, Aaron Tomlin <atomlin@atomlin.com>
Cc: arnd@arndb.de, mcgrof@kernel.org, da.gomez@kernel.org,
	samitolvanen@google.com, peterz@infradead.org, ojeda@kernel.org,
	akpm@linux-foundation.org, mhiramat@kernel.org, boqun@kernel.org,
	neelx@suse.com, da.anzani@gmail.com, sean@ashe.io,
	chjohnst@mail.com, steve@abita.co, mproche@mail.com,
	nick.lane@mail.com, linux-arch@vger.kernel.org,
	linux-modules@vger.kernel.org, rust-for-linux@vger.kernel.org,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH v9 0/2] module: Extend module_blacklist parameter to built-in modules
Date: Fri, 14 Aug 2026 13:16:01 +0200	[thread overview]
Message-ID: <9044355d-bff2-44fa-a8e2-ee3500aa1af0@suse.com> (raw)
In-Reply-To: <DKNWEO3BOUOL.9COZBXZIGS6A@garyguo.net>

On 8/13/26 4:50 PM, Gary Guo wrote:
> On Fri Aug 7, 2026 at 2:25 AM BST, Aaron Tomlin wrote:
>> Currently, the "module_blacklist=" command-line parameter only applies to
>> loadable modules. If a module is built-in, the parameter is silently
>> ignored. This patch series extends the blacklisting functionality to
>> built-in modules by intercepting their initialisation routines during early
>> boot.
>>
>> Following review feedback, the implementation has been split into two
>> separate changes to decouple the introduction of the new feature from the
>> terminology renaming:
>>
>>     1.  The first patch extends the "module_blacklist=" parameter to
>>         built-in modules using the original blacklist terminology. It
>>         introduces the ".initcall.modnames" section to map initcall
>>         function pointers to their associated KBUILD_MODNAME strings
>>         (restricted only to module_init() invocations to save memory and
>>         avoid matching core kernel subsystems). It also restricts the check
>>         to a boot-time __init wrapper to eliminate Use-After-Free (UAF) and
>>         Spectre v1 vulnerability risks when loading dynamic modules at
>>         runtime, and adds a fast-path check to eliminate lookup overhead
>>         when the parameter is not in use
>>
>>     2.  The second patch renames the variables and helper functions to
>>         adopt the preferred "module_denylist=" and module_is_denylisted()
>>         terminology in the codebase. To preserve the existing user-space
>>         ABI, "module_blacklist=" is kept as a legacy alias pointing to the
>>         same module_denylist variable
>>
>> Aaron Tomlin (2):
>>   module: Extend module_blacklist parameter to built-in modules
>>   module: Rename module_blacklist to module_denylist
> 
> I feel with
> https://lore.kernel.org/driver-core/20260421-acpi_mod_name-v2-0-e73f9310dad3@sony.com/
> and this we're really making loadable module and builtin modules less different.
> 
> I wonder if we should just somewhat unify these completly, so built-in modules
> just behave identically to loadable modules, just without runtime relocations
> and ability to unload.

I can imagine this being possible and potentially useful. For instance,
a minimal `struct module` could be used for each built-in and loadable
module. For the latter, it could be then extended to something like
`struct loadable_module` containing all the fields currently needed for
loadable modules.

It could also help improve some C APIs. Functions currently cannot
determine whether a NULL value passed as a module parameter indicates an
invalid pointer or a built-in module [1].

> 
> Of course, that's quite a big change... And mostly likely people won't care
> because almost everything is built as loadable modules in distros anyway.

I agree this looks non-trivial. It would require proper investigation to
see how it might actually turn out.

[1] https://lore.kernel.org/linux-modules/610fc63b-f3dc-4824-99fd-907fc96f3194@oracle.com/

-- 
Cheers,
Petr

      reply	other threads:[~2026-08-14 11:16 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-08-07  1:25 Aaron Tomlin
2026-08-07  1:26 ` [PATCH v9 1/2] " Aaron Tomlin
2026-08-13 14:15   ` Petr Pavlu
2026-08-13 14:56     ` Gary Guo
2026-08-14  9:38       ` Petr Pavlu
2026-08-07  1:26 ` [PATCH v9 2/2] module: Rename module_blacklist to module_denylist Aaron Tomlin
2026-08-13 14:50 ` [PATCH v9 0/2] module: Extend module_blacklist parameter to built-in modules Gary Guo
2026-08-14 11:16   ` Petr Pavlu [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=9044355d-bff2-44fa-a8e2-ee3500aa1af0@suse.com \
    --to=petr.pavlu@suse.com \
    --cc=akpm@linux-foundation.org \
    --cc=arnd@arndb.de \
    --cc=atomlin@atomlin.com \
    --cc=boqun@kernel.org \
    --cc=chjohnst@mail.com \
    --cc=da.anzani@gmail.com \
    --cc=da.gomez@kernel.org \
    --cc=gary@garyguo.net \
    --cc=linux-arch@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-modules@vger.kernel.org \
    --cc=mcgrof@kernel.org \
    --cc=mhiramat@kernel.org \
    --cc=mproche@mail.com \
    --cc=neelx@suse.com \
    --cc=nick.lane@mail.com \
    --cc=ojeda@kernel.org \
    --cc=peterz@infradead.org \
    --cc=rust-for-linux@vger.kernel.org \
    --cc=samitolvanen@google.com \
    --cc=sean@ashe.io \
    --cc=steve@abita.co \
    /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

all inboxes | Powered by JetHome®