Home Home > GIT Browse
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMiroslav Benes <mbenes@suse.cz>2018-11-02 17:07:16 +0100
committerMiroslav Benes <mbenes@suse.cz>2018-11-02 17:26:41 +0100
commitac36eb6dfa850ef2a98d42d4b6295abb5c1e0b3b (patch)
tree2e48b2ccb82222065e1fedc11cd6abc991fb931e
parent60eeb41aed43d88a54cfc9632beba4e1b29ce0d4 (diff)
modpost: ignore livepatch unresolved relocations (fate#326849).
-rw-r--r--patches.suse/livepatch-modpost-ignore-unresolved-symbols.patch50
-rw-r--r--series.conf3
2 files changed, 53 insertions, 0 deletions
diff --git a/patches.suse/livepatch-modpost-ignore-unresolved-symbols.patch b/patches.suse/livepatch-modpost-ignore-unresolved-symbols.patch
new file mode 100644
index 0000000000..bfc991ab24
--- /dev/null
+++ b/patches.suse/livepatch-modpost-ignore-unresolved-symbols.patch
@@ -0,0 +1,50 @@
+From: Josh Poimboeuf <jpoimboe@redhat.com>
+Subject: modpost: ignore livepatch unresolved relocations
+Patch-mainline: Submitted, https://lore.kernel.org/lkml/20170829190140.401-1-jmoreira@suse.de/
+References: fate#326849
+
+Make modpost ignore unresolved symbols when handling livepatches. These symbols
+are to be taken care of by klp-convert.
+
+Signed-off-by: Josh Poimboeuf <jpoimboe@redhat.com>
+Reviewed-by: Petr Mladek <pmladek@suse.com>
+Signed-off-by: Joao Moreira <jmoreira@suse.de>
+Signed-off-by: Miroslav Benes <mbenes@suse.cz>
+
+---
+ scripts/mod/modpost.c | 6 +++++-
+ scripts/mod/modpost.h | 1 +
+ 2 files changed, 6 insertions(+), 1 deletion(-)
+
+--- a/scripts/mod/modpost.c
++++ b/scripts/mod/modpost.c
+@@ -2072,6 +2072,10 @@ static void read_symbols(char *modname)
+ "license", license);
+ }
+
++ /* Livepatch modules have unresolved symbols resolved by klp-convert */
++ if (get_modinfo(info.modinfo, info.modinfo_len, "livepatch"))
++ mod->livepatch = 1;
++
+ for (sym = info.symtab_start; sym < info.symtab_stop; sym++) {
+ symname = remove_dot(info.strtab + sym->st_name);
+
+@@ -2282,7 +2286,7 @@ static int add_versions(struct buffer *b
+ for (s = mod->unres; s; s = s->next) {
+ exp = find_symbol(s->name);
+ if (!exp || exp->module == mod) {
+- if (have_vmlinux && !s->weak) {
++ if (have_vmlinux && !s->weak && !mod->livepatch) {
+ if (warn_unresolved) {
+ warn("\"%s\" [%s.ko] undefined!\n",
+ s->name, mod->name);
+--- a/scripts/mod/modpost.h
++++ b/scripts/mod/modpost.h
+@@ -117,6 +117,7 @@ struct module {
+ int skip;
+ int has_init;
+ int has_cleanup;
++ int livepatch;
+ struct buffer dev_table_buf;
+ char srcversion[25];
+ int is_dot_o;
diff --git a/series.conf b/series.conf
index d5047a11ab..0362bfbc06 100644
--- a/series.conf
+++ b/series.conf
@@ -19118,6 +19118,9 @@
# SUSE-specific
patches.suse/livepatch-send-a-fake-signal-periodically.patch
+ # klp-convert
+ patches.suse/livepatch-modpost-ignore-unresolved-symbols.patch
+
########################################################
# XEN patches
########################################################