From: Aaron Tomlin <atomlin@atomlin.com>
To: arnd@arndb.de, mcgrof@kernel.org, petr.pavlu@suse.com,
da.gomez@kernel.org, samitolvanen@google.com,
peterz@infradead.org
Cc: akpm@linux-foundation.org, mhiramat@kernel.org,
atomlin@atomlin.com, 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, linux-kernel@vger.kernel.org
Subject: [PATCH v5 2/2] module: Rename module_blacklist to module_denylist
Date: Sat, 18 Jul 2026 01:13:50 -0400 [thread overview]
Message-ID: <20260718051350.344772-3-atomlin@atomlin.com> (raw)
In-Reply-To: <20260718051350.344772-1-atomlin@atomlin.com>
To align with the kernel's established coding style guide regarding
naming conventions (i.e., Documentation/process/coding-style.rst),
migrate the internal module_blacklist variables and helper functions to
module_denylist and module_is_denylisted().
To preserve the existing user-space ABI and ensure backward
compatibility with existing bootloader and automated provisioning
configurations, "module_blacklist=" is retained as a legacy alias
tracking the underlying module_denylist infrastructure.
Signed-off-by: Aaron Tomlin <atomlin@atomlin.com>
---
include/linux/module.h | 2 +-
init/main.c | 17 +++++++++--------
kernel/module/main.c | 4 ++--
3 files changed, 12 insertions(+), 11 deletions(-)
diff --git a/include/linux/module.h b/include/linux/module.h
index fc1525e8f63c..e83ce13e6db5 100644
--- a/include/linux/module.h
+++ b/include/linux/module.h
@@ -884,7 +884,7 @@ static inline void module_for_each_mod(int(*func)(struct module *mod, void *data
}
#endif /* CONFIG_MODULES */
-bool module_is_blacklisted(const char *module_name);
+bool module_is_denylisted(const char *module_name);
#ifdef CONFIG_SYSFS
extern struct kset *module_kset;
diff --git a/init/main.c b/init/main.c
index 0cf64d19b43f..18291e9bab41 100644
--- a/init/main.c
+++ b/init/main.c
@@ -1337,17 +1337,17 @@ static inline void do_trace_initcall_level(const char *level)
extern struct initcall_modname __start_initcall_modnames[];
extern struct initcall_modname __stop_initcall_modnames[];
-/* module_blacklist is a comma-separated list of module names */
-static char *module_blacklist;
-bool __init_or_module module_is_blacklisted(const char *module_name)
+/* module_denylist is a comma-separated list of module names */
+static char *module_denylist;
+bool __init_or_module module_is_denylisted(const char *module_name)
{
const char *p;
size_t len;
- if (!module_blacklist)
+ if (!module_denylist)
return false;
- for (p = module_blacklist; *p; p += len) {
+ for (p = module_denylist; *p; p += len) {
len = strcspn(p, ",");
if (strlen(module_name) == len && !memcmp(module_name, p, len))
return true;
@@ -1356,7 +1356,8 @@ bool __init_or_module module_is_blacklisted(const char *module_name)
}
return false;
}
-core_param(module_blacklist, module_blacklist, charp, 0400);
+core_param(module_denylist, module_denylist, charp, 0400);
+core_param(module_blacklist, module_denylist, charp, 0400);
static const char *__init get_builtin_modname(initcall_t fn)
{
@@ -1377,9 +1378,9 @@ int __init_or_module do_one_initcall(initcall_t fn)
const char *modname = NULL;
int ret;
- if (system_state < SYSTEM_FREEING_INITMEM && module_blacklist) {
+ if (system_state < SYSTEM_FREEING_INITMEM && module_denylist) {
modname = get_builtin_modname(fn);
- if (modname && module_is_blacklisted(modname)) {
+ if (modname && module_is_denylisted(modname)) {
pr_info("Skipping initcall for blacklisted built-in module %s\n",
modname);
return 0;
diff --git a/kernel/module/main.c b/kernel/module/main.c
index 5c90ebedbf68..e6d9c52b9786 100644
--- a/kernel/module/main.c
+++ b/kernel/module/main.c
@@ -3369,9 +3369,9 @@ static int early_mod_check(struct load_info *info, int flags)
/*
* Now that we know we have the correct module name, check
- * if it's blacklisted.
+ * if it's denylisted.
*/
- if (module_is_blacklisted(info->name)) {
+ if (module_is_denylisted(info->name)) {
pr_err("Module %s is blacklisted\n", info->name);
return -EPERM;
}
--
2.54.0
prev parent reply other threads:[~2026-07-18 5:14 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-07-18 5:13 [PATCH v5 0/2] module: Extend blacklist parameter to support built-in modules Aaron Tomlin
2026-07-18 5:13 ` [PATCH v5 1/2] module: Extend module_blacklist parameter to " Aaron Tomlin
2026-07-18 14:26 ` Aaron Tomlin
2026-07-18 5:13 ` Aaron Tomlin [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=20260718051350.344772-3-atomlin@atomlin.com \
--to=atomlin@atomlin.com \
--cc=akpm@linux-foundation.org \
--cc=arnd@arndb.de \
--cc=chjohnst@mail.com \
--cc=da.anzani@gmail.com \
--cc=da.gomez@kernel.org \
--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=peterz@infradead.org \
--cc=petr.pavlu@suse.com \
--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
Powered by JetHome