livepatch: Disallow vmlinux.ko
authorJosh Poimboeuf <jpoimboe@redhat.com>
Wed, 29 Apr 2020 15:24:43 +0000 (10:24 -0500)
committerJiri Kosina <jkosina@suse.cz>
Thu, 7 May 2020 22:12:42 +0000 (00:12 +0200)
commitdcf550e52f567cb7a421169d2522869f9188aca5
tree8132935cd192b34addd1a3eb2c8cb120258510e6
parenta811c1fa0a02c062555b54651065899437bacdbe
livepatch: Disallow vmlinux.ko

This is purely a theoretical issue, but if there were a module named
vmlinux.ko, the livepatch relocation code wouldn't be able to
distinguish between vmlinux-specific and vmlinux.o-specific KLP
relocations.

If CONFIG_LIVEPATCH is enabled, don't allow a module named vmlinux.ko.

Suggested-by: Peter Zijlstra <peterz@infradead.org>
Signed-off-by: Josh Poimboeuf <jpoimboe@redhat.com>
Acked-by: Miroslav Benes <mbenes@suse.cz>
Acked-by: Joe Lawrence <joe.lawrence@redhat.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
kernel/livepatch/core.c