I made an NMU fixing this and the other RC bug, plus a double-build
failure I noticed while preparing it.

Ben.

-- 
Ben Hutchings
Design a system any fool can use, and only a fool will want to use it.


diff -Nru kpatch-0.6.0/debian/changelog kpatch-0.6.0/debian/changelog
--- kpatch-0.6.0/debian/changelog	2018-06-15 23:23:46.000000000 +0100
+++ kpatch-0.6.0/debian/changelog	2019-01-07 19:39:23.000000000 +0000
@@ -1,3 +1,13 @@
+kpatch (0.6.0-0.2) unstable; urgency=medium
+
+  * Non-maintainer upload
+  * kmod: Fix symbol lookup on Linux 4.19 (Closes: #917861)
+  * dkms: Pass target kernel version to the upstream clean target
+    (Closes: #917860)
+  * kpatch-build: Fix clean target
+
+ -- Ben Hutchings <b...@decadent.org.uk>  Mon, 07 Jan 2019 19:39:23 +0000
+
 kpatch (0.6.0-0.1) unstable; urgency=medium
 
   [Simon Ruderich]
diff -Nru kpatch-0.6.0/debian/kpatch-dkms.dkms kpatch-0.6.0/debian/kpatch-dkms.dkms
--- kpatch-0.6.0/debian/kpatch-dkms.dkms	2018-06-15 23:23:46.000000000 +0100
+++ kpatch-0.6.0/debian/kpatch-dkms.dkms	2019-01-07 19:24:43.000000000 +0000
@@ -2,7 +2,7 @@
 BUILT_MODULE_NAME="kpatch"
 BUILT_MODULE_LOCATION="kmod/core"
 DEST_MODULE_LOCATION="/updates/dkms"
-CLEAN="make -C kmod/ clean"
+CLEAN="make -C kmod/ KPATCH_BUILD=/lib/modules/${kernelver}/build clean"
 PACKAGE_NAME="kpatch"
 PACKAGE_VERSION=#MODULE_VERSION#
 REMAKE_INITRD="no"
diff -Nru kpatch-0.6.0/debian/patches/kmod-fix-symbol-lookup-on-linux-4.19.patch kpatch-0.6.0/debian/patches/kmod-fix-symbol-lookup-on-linux-4.19.patch
--- kpatch-0.6.0/debian/patches/kmod-fix-symbol-lookup-on-linux-4.19.patch	1970-01-01 01:00:00.000000000 +0100
+++ kpatch-0.6.0/debian/patches/kmod-fix-symbol-lookup-on-linux-4.19.patch	2019-01-07 19:38:41.000000000 +0000
@@ -0,0 +1,41 @@
+From: Ben Hutchings <b...@decadent.org.uk>
+Date: Mon, 07 Jan 2019 19:19:42 +0000
+Subject: kmod: Fix symbol lookup on Linux 4.19
+
+Since Linux 4.19, symbols may contain either an absolute address or a
+self-relative offset, depending on
+CONFIG_HAVE_ARCH_PREL32_RELOCATIONS.  The function to resolve the
+address is unfortunately not inline or exported, so copy it here.
+
+Since the configuration symbol didn't exist before, we don't need to
+add an explicit kernel version check.
+
+---
+--- a/kmod/core/core.c
++++ b/kmod/core/core.c
+@@ -636,6 +636,16 @@ static int kpatch_find_object_symbol(con
+ 	return -EINVAL;
+ }
+ 
++/* Copied from kernel/module.c */
++static unsigned long kernel_symbol_value(const struct kernel_symbol *sym)
++{
++#ifdef CONFIG_HAVE_ARCH_PREL32_RELOCATIONS
++	return (unsigned long)offset_to_ptr(&sym->value_offset);
++#else
++	return sym->value;
++#endif
++}
++
+ /*
+  * External symbols are located outside the parent object (where the parent
+  * object is either vmlinux or the kmod being patched).
+@@ -651,7 +661,7 @@ static int kpatch_find_external_symbol(c
+ 	sym = find_symbol(name, NULL, NULL, true, true);
+ 	preempt_enable();
+ 	if (sym) {
+-		*addr = sym->value;
++		*addr = kernel_symbol_value(sym);
+ 		return 0;
+ 	}
+ 
diff -Nru kpatch-0.6.0/debian/patches/kpatch-build-fix-clean-target.patch kpatch-0.6.0/debian/patches/kpatch-build-fix-clean-target.patch
--- kpatch-0.6.0/debian/patches/kpatch-build-fix-clean-target.patch	1970-01-01 01:00:00.000000000 +0100
+++ kpatch-0.6.0/debian/patches/kpatch-build-fix-clean-target.patch	2019-01-07 19:38:19.000000000 +0000
@@ -0,0 +1,17 @@
+From: Ben Hutchings <b...@decadent.org.uk>
+Date: Mon, 07 Jan 2019 19:37:04 +0000
+Subject: kpatch-build: Fix clean target
+
+The clean target uses brace-expansion which is a bash extension not
+supported by e.g. dash.  Force use of bash for this target.
+
+---
+--- a/kpatch-build/Makefile
++++ b/kpatch-build/Makefile
+@@ -43,5 +43,6 @@ uninstall:
+ 	$(RM) -R $(LIBEXECDIR)
+ 	$(RM) $(BINDIR)/kpatch-build
+ 
++clean: SHELL = /bin/bash
+ clean:
+ 	$(RM) $(TARGETS) *.{o,d} insn/*.{o,d} gcc-plugins/*.{so,d}
diff -Nru kpatch-0.6.0/debian/patches/series kpatch-0.6.0/debian/patches/series
--- kpatch-0.6.0/debian/patches/series	2018-06-15 23:23:46.000000000 +0100
+++ kpatch-0.6.0/debian/patches/series	2019-01-07 19:38:32.000000000 +0000
@@ -1,2 +1,4 @@
 kpatch-build-adjust-dirs.patch
 Fix-build-err-by-Werror-maybe-uninitialized.patch
+kmod-fix-symbol-lookup-on-linux-4.19.patch
+kpatch-build-fix-clean-target.patch

Attachment: signature.asc
Description: This is a digitally signed message part

Reply via email to