Commit 47cc75aa authored by Aaron Tomlin's avatar Aaron Tomlin Committed by Linus Torvalds

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: default avatarAlexey Dobriyan <adobriyan@gmail.com>
Fixes: 99bd9956 ("module: Introduce module unload taint tracking")
Signed-off-by: default avatarAaron Tomlin <atomlin@redhat.com>
Acked-by: default avatarLuis Chamberlain <mcgrof@kernel.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
parent 385f4a10
......@@ -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) &&
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment