From: Aaron Tomlin <atomlin@redhat.com>
To: mcgrof@kernel.org
Cc: adobriyan@gmail.com, linux-kernel@vger.kernel.org,
linux-modules@vger.kernel.org, atomlin@atomlin.com
Subject: [PATCH modules-next] module: tracking: Keep a record of tainted unloaded modules only
Date: Fri, 7 Oct 2022 14:38:12 +0100 [thread overview]
Message-ID: <20221007133812.804837-1-atomlin@redhat.com> (raw)
This patch ensures that no module record/or entry is added to the
unloaded_tainted_modules list if it does not carry a taint.
Reported-by: Alexey Dobriyan <adobriyan@gmail.com>
Fixes: 99bd9956551b ("module: Introduce module unload taint tracking")
Signed-off-by: Aaron Tomlin <atomlin@redhat.com>
---
kernel/module/tracking.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/kernel/module/tracking.c b/kernel/module/tracking.c
index a139e63b6f20..26d812e07615 100644
--- a/kernel/module/tracking.c
+++ b/kernel/module/tracking.c
@@ -22,6 +22,9 @@ int try_add_tainted_module(struct module *mod)
module_assert_mutex_or_preempt();
+ if (!mod->taints)
+ goto out;
+
list_for_each_entry_rcu(mod_taint, &unloaded_tainted_modules, list,
lockdep_is_held(&module_mutex)) {
if (!strcmp(mod_taint->name, mod->name) &&
--
2.37.3
next reply other threads:[~2022-10-07 13:38 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-10-07 13:38 Aaron Tomlin [this message]
2022-10-07 17:51 ` [PATCH modules-next] module: tracking: Keep a record of tainted unloaded modules only Luis Chamberlain
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=20221007133812.804837-1-atomlin@redhat.com \
--to=atomlin@redhat.com \
--cc=adobriyan@gmail.com \
--cc=atomlin@atomlin.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-modules@vger.kernel.org \
--cc=mcgrof@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.