From: sashiko-bot@kernel.org
To: "Aaron Tomlin" <atomlin@atomlin.com>
Cc: linux-modules@vger.kernel.org
Subject: Re: [PATCH v6 2/2] module: Rename module_blacklist to module_denylist
Date: Sat, 18 Jul 2026 19:11:36 +0000 [thread overview]
Message-ID: <20260718191138.100B01F000E9@smtp.kernel.org> (raw)
In-Reply-To: <20260718190121.378314-3-atomlin@atomlin.com>
Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
Pre-existing issues:
- [High] The module denylist/blacklist fails to block modules if the command-line parameter uses a hyphen while the internal module name uses an underscore.
--
--- Patch [2]: [PATCH v6 2/2] module: Rename module_blacklist to module_denylist ---
commit e8f656a2a563ecf3826a9353c13ab68af8069728
Author: Aaron Tomlin <atomlin@atomlin.com>
module: Rename module_blacklist to module_denylist
This patch renames the module_blacklist parameter to module_denylist while
keeping the old parameter as a legacy alias. It also marks the old parameter
as deprecated in the documentation and updates internal symbol names.
> diff --git a/init/main.c b/init/main.c
> --- a/init/main.c
> +++ b/init/main.c
[ ... ]
> @@ -1368,17 +1368,17 @@ static inline void do_trace_initcall_level(const char *level)
[ ... ]
> -bool __init_or_module module_is_blacklisted(const char *module_name)
> +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))
[Severity: High]
This isn't a bug introduced by this patch, but does this strict byte-by-byte
comparison fail to account for the kernel's inherent hyphen-to-underscore
normalization in module names?
When an administrator specifies a module name containing a hyphen in the
module_denylist= parameter (e.g., usb-storage), the internal module name
will typically contain an underscore (e.g., usb_storage) because the kernel
build system automatically normalizes them.
Since memcmp() is used here in module_is_denylisted(), won't the comparison
fail, allowing the explicitly blocked module to load and bypassing the
intended security mechanism?
--
Sashiko AI review · https://sashiko.dev/#/patchset/20260718190121.378314-1-atomlin@atomlin.com?part=2
prev parent reply other threads:[~2026-07-18 19:11 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-07-18 19:01 [PATCH v6 0/2] module: Extend blacklist parameter to support built-in modules Aaron Tomlin
2026-07-18 19:01 ` [PATCH v6 1/2] module: Extend module_blacklist parameter to " Aaron Tomlin
2026-07-18 19:01 ` [PATCH v6 2/2] module: Rename module_blacklist to module_denylist Aaron Tomlin
2026-07-18 19:11 ` sashiko-bot [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=20260718191138.100B01F000E9@smtp.kernel.org \
--to=sashiko-bot@kernel.org \
--cc=atomlin@atomlin.com \
--cc=linux-modules@vger.kernel.org \
--cc=sashiko-reviews@lists.linux.dev \
/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