]> git.baikalelectronics.ru Git - kernel.git/commit
livepatch/module: make TAINT_LIVEPATCH module-specific
authorJosh Poimboeuf <jpoimboe@redhat.com>
Thu, 25 Aug 2016 15:04:45 +0000 (10:04 -0500)
committerJiri Kosina <jkosina@suse.cz>
Fri, 26 Aug 2016 12:42:08 +0000 (14:42 +0200)
commit40886892e996d750f5384fb8eca5f8e384307efc
treeccf3c4e15ecccd15e5f70b44971f4e884a443c60
parenta32df9fa1967815b19a852cb0fe2b14a7aea640f
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>
kernel/livepatch/core.c
kernel/module.c