From: Aaron Tomlin <atomlin@redhat.com>
To: mcgrof@kernel.org
Cc: cl@linux.com, pmladek@suse.com, mbenes@suse.cz,
christophe.leroy@csgroup.eu, akpm@linux-foundation.org,
linux-kernel@vger.kernel.org, linux-modules@vger.kernel.org,
atomlin@atomlin.com, ghalat@redhat.com, oleksandr@natalenko.name,
neelx@redhat.com
Subject: [PATCH v3 1/2] module: Make module_flags_taint() accept a module's taints bitmap directly
Date: Wed, 20 Apr 2022 12:52:56 +0100 [thread overview]
Message-ID: <20220420115257.3498300-2-atomlin@redhat.com> (raw)
In-Reply-To: <20220420115257.3498300-1-atomlin@redhat.com>
No functional change.
The purpose of this patch is to modify module_flags_taint() to accept a
module's taints bitmap as a parameter and modifies all users accordingly.
This is in preparation for module unload taint tracking support.
Signed-off-by: Aaron Tomlin <atomlin@redhat.com>
---
kernel/module/main.c | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/kernel/module/main.c b/kernel/module/main.c
index 05a42d8fcd7a..ea78cec316dd 100644
--- a/kernel/module/main.c
+++ b/kernel/module/main.c
@@ -890,13 +890,13 @@ static inline int module_unload_init(struct module *mod)
}
#endif /* CONFIG_MODULE_UNLOAD */
-static size_t module_flags_taint(struct module *mod, char *buf)
+static size_t module_flags_taint(unsigned long taints, char *buf)
{
size_t l = 0;
int i;
for (i = 0; i < TAINT_FLAGS_COUNT; i++) {
- if (taint_flags[i].module && test_bit(i, &mod->taints))
+ if (taint_flags[i].module && test_bit(i, &taints))
buf[l++] = taint_flags[i].c_true;
}
@@ -974,7 +974,7 @@ static ssize_t show_taint(struct module_attribute *mattr,
{
size_t l;
- l = module_flags_taint(mk->mod, buffer);
+ l = module_flags_taint(mk->mod->taints, buffer);
buffer[l++] = '\n';
return l;
}
@@ -2993,7 +2993,7 @@ char *module_flags(struct module *mod, char *buf)
mod->state == MODULE_STATE_GOING ||
mod->state == MODULE_STATE_COMING) {
buf[bx++] = '(';
- bx += module_flags_taint(mod, buf + bx);
+ bx += module_flags_taint(mod->taints, buf + bx);
/* Show a - for module-is-being-unloaded */
if (mod->state == MODULE_STATE_GOING)
buf[bx++] = '-';
--
2.34.1
next prev parent reply other threads:[~2022-04-20 11:53 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-04-20 11:52 [PATCH v3 0/2] module: Introduce module unload taint tracking Aaron Tomlin
2022-04-20 11:52 ` Aaron Tomlin [this message]
2022-04-20 11:52 ` [PATCH v3 2/2] " Aaron Tomlin
2022-04-21 6:43 ` kernel test robot
2022-04-21 14:28 ` Oleksandr Natalenko
2022-04-21 14:57 ` Aaron Tomlin
2022-04-22 8:11 ` Christoph Lameter
2022-04-22 12:23 ` 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=20220420115257.3498300-2-atomlin@redhat.com \
--to=atomlin@redhat.com \
--cc=akpm@linux-foundation.org \
--cc=atomlin@atomlin.com \
--cc=christophe.leroy@csgroup.eu \
--cc=cl@linux.com \
--cc=ghalat@redhat.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-modules@vger.kernel.org \
--cc=mbenes@suse.cz \
--cc=mcgrof@kernel.org \
--cc=neelx@redhat.com \
--cc=oleksandr@natalenko.name \
--cc=pmladek@suse.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;
as well as URLs for NNTP newsgroup(s).