Skip to content

Commit 47cc75a

Browse files
Aaron Tomlintorvalds
authored andcommitted
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: 99bd995 ("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]>
1 parent 385f4a1 commit 47cc75a

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

kernel/module/tracking.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,9 @@ int try_add_tainted_module(struct module *mod)
2222

2323
module_assert_mutex_or_preempt();
2424

25+
if (!mod->taints)
26+
goto out;
27+
2528
list_for_each_entry_rcu(mod_taint, &unloaded_tainted_modules, list,
2629
lockdep_is_held(&module_mutex)) {
2730
if (!strcmp(mod_taint->name, mod->name) &&

0 commit comments

Comments
 (0)