aboutsummaryrefslogtreecommitdiffstats
path: root/kernel/livepatch
diff options
context:
space:
mode:
authorJosh Poimboeuf <jpoimboe@redhat.com>2016-08-25 11:04:45 -0400
committerJiri Kosina <jkosina@suse.cz>2016-08-26 08:42:08 -0400
commit2992ef29ae01af998399d55ed7c692a2505fb8af (patch)
treeccf3c4e15ecccd15e5f70b44971f4e884a443c60 /kernel/livepatch
parent5ad75fcdd712d18b393c3b3fe52ab4108703d337 (diff)
livepatch/module: make TAINT_LIVEPATCH module-specific
There's no reliable way to determine which module tainted the kernel with TAINT_LIVEPATCH. For example, /sys/module/<klp module>/taint doesn't report it. Neither does the "mod -t" command in the crash tool. Make it crystal clear who the guilty party is by associating TAINT_LIVEPATCH with any module which sets the "livepatch" modinfo attribute. The flag will still get set in the kernel like before, but now it also sets the same flag in mod->taint. Note that now the taint flag gets set when the module is loaded rather than when it's enabled. I also renamed find_livepatch_modinfo() to check_modinfo_livepatch() to better reflect its purpose: it's basically a livepatch-specific sub-function of check_modinfo(). Reported-by: Chunyu Hu <chuhu@redhat.com> Reviewed-by: Petr Mladek <pmladek@suse.com> Acked-by: Miroslav Benes <mbenes@suse.cz> Acked-by: Jessica Yu <jeyu@redhat.com> Acked-by: Rusty Russell <rusty@rustcorp.com.au> Signed-off-by: Josh Poimboeuf <jpoimboe@redhat.com> Signed-off-by: Jiri Kosina <jkosina@suse.cz>
Diffstat (limited to 'kernel/livepatch')
-rw-r--r--kernel/livepatch/core.c3
1 files changed, 0 insertions, 3 deletions
diff --git a/kernel/livepatch/core.c b/kernel/livepatch/core.c
index 5fbabe022286..af4643873e71 100644
--- a/kernel/livepatch/core.c
+++ b/kernel/livepatch/core.c
@@ -545,9 +545,6 @@ static int __klp_enable_patch(struct klp_patch *patch)
545 list_prev_entry(patch, list)->state == KLP_DISABLED) 545 list_prev_entry(patch, list)->state == KLP_DISABLED)
546 return -EBUSY; 546 return -EBUSY;
547 547
548 pr_notice_once("tainting kernel with TAINT_LIVEPATCH\n");
549 add_taint(TAINT_LIVEPATCH, LOCKDEP_STILL_OK);
550
551 pr_notice("enabling patch '%s'\n", patch->mod->name); 548 pr_notice("enabling patch '%s'\n", patch->mod->name);
552 549
553 klp_for_each_object(patch, obj) { 550 klp_for_each_object(patch, obj) {