mirror of
https://github.com/linux-msm/laptops-kernel.git
synced 2026-08-13 14:19:53 -07:00
livepatch/klp-build: Introduce klp-build script for generating livepatch modules
Add a klp-build script which automates the generation of a livepatch
module from a source .patch file by performing the following steps:
- Builds an original kernel with -function-sections and
-fdata-sections, plus objtool function checksumming.
- Applies the .patch file and rebuilds the kernel using the same
options.
- Runs 'objtool klp diff' to detect changed functions and generate
intermediate binary diff objects.
- Builds a kernel module which links the diff objects with some
livepatch module init code (scripts/livepatch/init.c).
- Finalizes the livepatch module (aka work around linker wreckage)
using 'objtool klp post-link'.
Acked-by: Petr Mladek <pmladek@suse.com>
Tested-by: Joe Lawrence <joe.lawrence@redhat.com>
Signed-off-by: Josh Poimboeuf <jpoimboe@kernel.org>
This commit is contained in:
@@ -173,6 +173,7 @@ ifdef CONFIG_OBJTOOL
|
||||
|
||||
objtool := $(objtree)/tools/objtool/objtool
|
||||
|
||||
objtool-args-$(CONFIG_KLP_BUILD) += --checksum
|
||||
objtool-args-$(CONFIG_HAVE_JUMP_LABEL_HACK) += --hacks=jump_label
|
||||
objtool-args-$(CONFIG_HAVE_NOINSTR_HACK) += --hacks=noinstr
|
||||
objtool-args-$(CONFIG_MITIGATION_CALL_DEPTH_TRACKING) += --hacks=skylake
|
||||
|
||||
@@ -23,7 +23,7 @@ BEGIN {
|
||||
|
||||
in_hunk = 1
|
||||
|
||||
# for @@ -1,3 +1,4 @@:
|
||||
# @@ -1,3 +1,4 @@:
|
||||
# 1: line number in old file
|
||||
# 3: how many lines the hunk covers in old file
|
||||
# 1: line number in new file
|
||||
|
||||
Executable
+743
File diff suppressed because it is too large
Load Diff
@@ -241,10 +241,12 @@ static struct symbol *next_file_symbol(struct elf *elf, struct symbol *sym)
|
||||
static bool is_uncorrelated_static_local(struct symbol *sym)
|
||||
{
|
||||
static const char * const vars[] = {
|
||||
"__key.",
|
||||
"__warned.",
|
||||
"__already_done.",
|
||||
"__func__.",
|
||||
"__key.",
|
||||
"__warned.",
|
||||
"_entry.",
|
||||
"_entry_ptr.",
|
||||
"_rs.",
|
||||
"descriptor.",
|
||||
"CSWTCH.",
|
||||
|
||||
Reference in New Issue
Block a user