diff options
| author | Aaron Tomlin <[email protected]> | 2022-10-07 14:38:12 +0100 |
|---|---|---|
| committer | Linus Torvalds <[email protected]> | 2022-10-10 12:16:19 -0700 |
| commit | 47cc75aa92837a9d3f15157d6272ff285585d75d (patch) | |
| tree | 348abc250461d8b242d481cbe6bd038f23972e70 /kernel/module | |
| parent | 385f4a10191d95f40b5af72097df06e70f85d69a (diff) | |
module: tracking: Keep a record of tainted unloaded modules only
This 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 <[email protected]>
Fixes: 99bd9956551b ("module: Introduce module unload taint tracking")
Signed-off-by: Aaron Tomlin <[email protected]>
Acked-by: Luis Chamberlain <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
Diffstat (limited to 'kernel/module')
| -rw-r--r-- | kernel/module/tracking.c | 3 |
1 files changed, 3 insertions, 0 deletions
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) && |