From: Petr Pavlu <petr.pavlu@suse.com>
To: Luis Chamberlain <mcgrof@kernel.org>,
Petr Pavlu <petr.pavlu@suse.com>,
Daniel Gomez <da.gomez@kernel.org>,
Sami Tolvanen <samitolvanen@google.com>
Cc: Aaron Tomlin <atomlin@atomlin.com>,
linux-modules@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: [PATCH 3/3] module: Move mod_unload_taint to tracking.c
Date: Tue, 20 Oct 2026 16:05:21 +0200 [thread overview]
Message-ID: <20261020-taint-unload-v1-3-d1c764889afc@suse.com> (raw)
In-Reply-To: <20261020-taint-unload-v1-0-d1c764889afc@suse.com>
Move the definition of mod_unload_taint from internal.h to tracking.c, as
it doesn't need to be exposed to other module code, and remove the
redundant declaration of mod_debugfs_root from tracking.c, as it is already
declared in internal.h.
This is a non-functional change.
Signed-off-by: Petr Pavlu <petr.pavlu@suse.com>
---
kernel/module/internal.h | 13 -------------
kernel/module/tracking.c | 14 +++++++++++++-
2 files changed, 13 insertions(+), 14 deletions(-)
diff --git a/kernel/module/internal.h b/kernel/module/internal.h
index 70ef20b97c84..3aca22253296 100644
--- a/kernel/module/internal.h
+++ b/kernel/module/internal.h
@@ -253,19 +253,6 @@ static inline void kmod_dup_request_announce(char *module_name, int ret)
#endif
#ifdef CONFIG_MODULE_UNLOAD_TAINT_TRACKING
-struct mod_unload_taint {
- struct list_head list;
- char name[MODULE_NAME_LEN];
- unsigned long taints;
-
- /*
- * Number of times a module with this name and taint combination has
- * been unloaded. Updates are serialized by module_mutex and use
- * WRITE_ONCE(). Readers that may run concurrently use READ_ONCE().
- */
- unsigned int count;
-};
-
int try_add_tainted_module(struct module *mod);
void print_unloaded_tainted_modules(void);
#else /* !CONFIG_MODULE_UNLOAD_TAINT_TRACKING */
diff --git a/kernel/module/tracking.c b/kernel/module/tracking.c
index 873fceb30526..46840dc22dcb 100644
--- a/kernel/module/tracking.c
+++ b/kernel/module/tracking.c
@@ -14,8 +14,20 @@
#include <linux/rculist.h>
#include "internal.h"
+struct mod_unload_taint {
+ struct list_head list;
+ char name[MODULE_NAME_LEN];
+ unsigned long taints;
+
+ /*
+ * Number of times a module with this name and taint combination has
+ * been unloaded. Updates are serialized by module_mutex and use
+ * WRITE_ONCE(). Readers that may run concurrently use READ_ONCE().
+ */
+ unsigned int count;
+};
+
static LIST_HEAD(unloaded_tainted_modules);
-extern struct dentry *mod_debugfs_root;
int try_add_tainted_module(struct module *mod)
{
--
2.55.0
next prev parent reply other threads:[~2026-10-20 14:07 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-10-20 14:05 [PATCH 0/3] module: Fixes to tracking taint flags for unloaded modules Petr Pavlu
2026-10-20 14:05 ` [PATCH 1/3] module: Fix missing " Petr Pavlu
2026-10-20 15:10 ` Aaron Tomlin
2026-10-20 14:05 ` [PATCH 2/3] module: Fix data race on mod_unload_taint::count Petr Pavlu
2026-10-20 14:05 ` Petr Pavlu [this message]
2026-10-20 15:09 ` [PATCH 3/3] module: Move mod_unload_taint to tracking.c Aaron Tomlin
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=20261020-taint-unload-v1-3-d1c764889afc@suse.com \
--to=petr.pavlu@suse.com \
--cc=atomlin@atomlin.com \
--cc=da.gomez@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-modules@vger.kernel.org \
--cc=mcgrof@kernel.org \
--cc=samitolvanen@google.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
all inboxes | Powered by JetHome®