]> Git Repo - linux.git/commitdiff
module: tracking: Keep a record of tainted unloaded modules only
authorAaron Tomlin <[email protected]>
Fri, 7 Oct 2022 13:38:12 +0000 (14:38 +0100)
committerLinus Torvalds <[email protected]>
Mon, 10 Oct 2022 19:16:19 +0000 (12:16 -0700)
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]>
kernel/module/tracking.c

index a139e63b6f201ba5c272a07cf7a2fdb89e25e88d..26d812e0761526021087937754e38c4e9011b0d7 100644 (file)
@@ -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) &&
This page took 0.05583 seconds and 4 git commands to generate.