Commit a12b9451 authored by Luis Chamberlain's avatar Luis Chamberlain

module: move tainting until after a module hits our linked list

It is silly to have taints spread out all over, we can just compromise
and add them if the module ever hit our linked list. Our sanity checkers
should just prevent crappy drivers / bogus ELF modules / etc and kconfig
options should be enough to let you *not* load things you don't want.
Signed-off-by: default avatarLuis Chamberlain <mcgrof@kernel.org>
parent 437c1f9c
......@@ -2009,18 +2009,6 @@ static int check_modinfo(struct module *mod, struct load_info *info, int flags)
if (err)
return err;
/*
* We are tainting your kernel *even* if you try to load
* modules with possible taints and we fail to load these
* modules for other reasons.
*
* We have a descrepancy though, see the other taints for
* signature and those in check_module_license_and_versions().
*
* We should compromise and converge.
*/
module_augment_kernel_taints(mod, info);
return 0;
}
......@@ -2772,6 +2760,16 @@ static int load_module(struct load_info *info, const char __user *uargs,
if (err)
goto free_module;
/*
* We are tainting your kernel if your module gets into
* the modules linked list somehow.
*
* We have a descrepancy though, see the other taints for
* signature and those in check_module_license_and_versions().
*
* We should compromise and converge.
*/
module_augment_kernel_taints(mod, info);
#ifdef CONFIG_MODULE_SIG
mod->sig_ok = info->sig_ok;
if (!mod->sig_ok) {
......
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