Blame SOURCES/v0.9.7-backport-MR-1315-Static-call-fixes.patch

497ac3
From 358743e6d8748510f4c9a71511d7ceea7c72f7aa Mon Sep 17 00:00:00 2001
497ac3
From: Josh Poimboeuf <jpoimboe@redhat.com>
497ac3
Date: Mon, 21 Nov 2022 19:23:07 -0800
497ac3
Subject: [PATCH] v0.9.7 backport: MR!1315 ("Static call fixes")
497ac3
497ac3
commit 87ad96760a3af0db294d44865dfa1703f57f5595
497ac3
Author: Josh Poimboeuf <jpoimboe@redhat.com>
497ac3
Date:   Mon Nov 21 19:23:07 2022 -0800
497ac3
497ac3
    create-diff-object: fix s390 special_section initializer spacing
497ac3
497ac3
    Align the s390 special_section initializers to improve readability and
497ac3
    for consistency with the rest.
497ac3
497ac3
    Signed-off-by: Josh Poimboeuf <jpoimboe@redhat.com>
497ac3
497ac3
commit 56bd8c4d0da1634f8549e7269f77a53e9d936a57
497ac3
Author: Josh Poimboeuf <jpoimboe@redhat.com>
497ac3
Date:   Mon Nov 21 19:27:23 2022 -0800
497ac3
497ac3
    create-diff-object: refactor jump label filtering
497ac3
497ac3
    Convert the hard-coded should_keep_jump_label() to a proper callback,
497ac3
    since static calls will need a similar filter.
497ac3
497ac3
    Signed-off-by: Josh Poimboeuf <jpoimboe@redhat.com>
497ac3
497ac3
commit f83218ad12a2d9e20d99d379c78974a576aa558c
497ac3
Author: Josh Poimboeuf <jpoimboe@redhat.com>
497ac3
Date:   Mon Nov 21 19:29:53 2022 -0800
497ac3
497ac3
    create-diff-object: detect unsupported static calls
497ac3
497ac3
    Similar to jump labels, static calls aren't supported when the static
497ac3
    call key was originally defined in a module rather than in vmlinux.
497ac3
    Detect those cases and either remove them (in the case of tracepoints)
497ac3
    or error out.
497ac3
497ac3
    Signed-off-by: Josh Poimboeuf <jpoimboe@redhat.com>
497ac3
497ac3
commit ab2397c03e31f0f697aa8bf943d70b4e5a7def54
497ac3
Author: Josh Poimboeuf <jpoimboe@redhat.com>
497ac3
Date:   Mon Nov 21 19:41:30 2022 -0800
497ac3
497ac3
    kpatch-macros: add KPATCH_STATIC_CALL()
497ac3
497ac3
    Signed-off-by: Josh Poimboeuf <jpoimboe@redhat.com>
497ac3
497ac3
commit 92c178b6a30a827c48db46ff4238501ec406a28e
497ac3
Author: Josh Poimboeuf <jpoimboe@redhat.com>
497ac3
Date:   Tue Nov 22 12:53:09 2022 -0800
497ac3
497ac3
    create-diff-object: use errx() instead of err()
497ac3
497ac3
    Otherwise on recent distros it appends the errno to the error message,
497ac3
    like:
497ac3
497ac3
      create-diff-object: ERROR: x86.o: kpatch_regenerate_special_section: 2633: Found 1 unsupported static call(s) in the patched code. Use KPATCH_STATIC_CALL() instead.: Success
497ac3
497ac3
    which is not what we want in most cases.
497ac3
497ac3
    Signed-off-by: Josh Poimboeuf <jpoimboe@redhat.com>
497ac3
497ac3
Signed-off-by: Yannick Cote <ycote@redhat.com>
497ac3
---
497ac3
 kmod/patch/kpatch-macros.h        |  11 +
497ac3
 kpatch-build/create-diff-object.c | 328 ++++++++++++++++++------------
497ac3
 kpatch-build/log.h                |   2 +-
497ac3
 3 files changed, 211 insertions(+), 130 deletions(-)
497ac3
497ac3
diff --git a/kmod/patch/kpatch-macros.h b/kmod/patch/kpatch-macros.h
497ac3
index 8e09702ea001..b797838849ca 100644
497ac3
--- a/kmod/patch/kpatch-macros.h
497ac3
+++ b/kmod/patch/kpatch-macros.h
497ac3
@@ -141,4 +141,15 @@ struct kpatch_post_unpatch_callback {
497ac3
 		printk(_fmt, ## __VA_ARGS__); \
497ac3
 })
497ac3
 
497ac3
+/*
497ac3
+ * KPATCH_STATIC_CALL macro
497ac3
+ *
497ac3
+ * Replace usages of static_call() with this macro, when create-diff-object
497ac3
+ * recommends it due to the original static call key living in a module.
497ac3
+ *
497ac3
+ * This converts the static call to a regular indirect call.
497ac3
+ */
497ac3
+#define KPATCH_STATIC_CALL(name) \
497ac3
+	((typeof(STATIC_CALL_TRAMP(name))*)(STATIC_CALL_KEY(name).func))
497ac3
+
497ac3
 #endif /* __KPATCH_MACROS_H_ */
497ac3
diff --git a/kpatch-build/create-diff-object.c b/kpatch-build/create-diff-object.c
497ac3
index 7106b67cfd25..ddaa9b44f11e 100644
497ac3
--- a/kpatch-build/create-diff-object.c
497ac3
+++ b/kpatch-build/create-diff-object.c
497ac3
@@ -56,7 +56,7 @@
497ac3
 #define DIFF_FATAL(format, ...) \
497ac3
 ({ \
497ac3
 	fprintf(stderr, "ERROR: %s: " format "\n", childobj, ##__VA_ARGS__); \
497ac3
-	err(EXIT_STATUS_DIFF_FATAL, "unreconcilable difference"); \
497ac3
+	errx(EXIT_STATUS_DIFF_FATAL, "unreconcilable difference"); \
497ac3
 })
497ac3
 
497ac3
 char *childobj;
497ac3
@@ -71,6 +71,8 @@ enum loglevel loglevel = NORMAL;
497ac3
 
497ac3
 bool KLP_ARCH;
497ac3
 
497ac3
+int jump_label_errors, static_call_errors;
497ac3
+
497ac3
 /*******************
497ac3
  * Data structures
497ac3
  * ****************/
497ac3
@@ -78,6 +80,9 @@ struct special_section {
497ac3
 	char *name;
497ac3
 	enum architecture arch;
497ac3
 	int (*group_size)(struct kpatch_elf *kelf, int offset);
497ac3
+	bool (*group_filter)(struct lookup_table *lookup,
497ac3
+			     struct section *relasec, unsigned int offset,
497ac3
+			     unsigned int size);
497ac3
 };
497ac3
 
497ac3
 /*************
497ac3
@@ -2215,6 +2220,169 @@ static int fixup_group_size(struct kpatch_elf *kelf, int offset)
497ac3
 	return (int)(rela->addend - offset);
497ac3
 }
497ac3
 
497ac3
+static bool jump_table_group_filter(struct lookup_table *lookup,
497ac3
+				    struct section *relasec,
497ac3
+				    unsigned int group_offset,
497ac3
+				    unsigned int group_size)
497ac3
+{
497ac3
+	struct rela *code = NULL, *key = NULL, *rela;
497ac3
+	bool tracepoint = false, dynamic_debug = false;
497ac3
+	struct lookup_result symbol;
497ac3
+	int i = 0;
497ac3
+
497ac3
+	/*
497ac3
+	 * Here we hard-code knowledge about the contents of the jump_entry
497ac3
+	 * struct.  It has three fields: code, target, and key.  Each field has
497ac3
+	 * a relocation associated with it.
497ac3
+	 */
497ac3
+	list_for_each_entry(rela, &relasec->relas, list) {
497ac3
+		if (rela->offset >= group_offset &&
497ac3
+		    rela->offset < group_offset + group_size) {
497ac3
+			if (i == 0)
497ac3
+				code = rela;
497ac3
+			else if (i == 2)
497ac3
+				key = rela;
497ac3
+			i++;
497ac3
+		}
497ac3
+	}
497ac3
+
497ac3
+	if (i != 3 || !key || !code)
497ac3
+		ERROR("BUG: __jump_table has an unexpected format");
497ac3
+
497ac3
+	if (!strncmp(key->sym->name, "__tracepoint_", 13))
497ac3
+		tracepoint = true;
497ac3
+
497ac3
+	if (is_dynamic_debug_symbol(key->sym))
497ac3
+		dynamic_debug = true;
497ac3
+
497ac3
+	if (KLP_ARCH) {
497ac3
+		/*
497ac3
+		 * On older kernels (with .klp.arch support), jump labels
497ac3
+		 * aren't supported at all.  Error out when they occur in a
497ac3
+		 * replacement function, with the exception of tracepoints and
497ac3
+		 * dynamic debug printks.  An inert tracepoint or printk is
497ac3
+		 * harmless enough, but a broken jump label can cause
497ac3
+		 * unexpected behavior.
497ac3
+		 */
497ac3
+		if (tracepoint || dynamic_debug)
497ac3
+			return false;
497ac3
+
497ac3
+		/*
497ac3
+		 * This will be upgraded to an error after all jump labels have
497ac3
+		 * been reported.
497ac3
+		 */
497ac3
+		log_normal("Found a jump label at %s()+0x%lx, using key %s.  Jump labels aren't supported with this kernel.  Use static_key_enabled() instead.\n",
497ac3
+			   code->sym->name, code->addend, key->sym->name);
497ac3
+		jump_label_errors++;
497ac3
+		return false;
497ac3
+	}
497ac3
+
497ac3
+	/*
497ac3
+	 * On newer (5.8+) kernels, jump labels are supported in the case where
497ac3
+	 * the corresponding static key lives in vmlinux.  That's because such
497ac3
+	 * kernels apply vmlinux-specific .klp.rela sections at the same time
497ac3
+	 * (in the klp module load) as normal relas, before jump label init.
497ac3
+	 * On the other hand, jump labels based on static keys which are
497ac3
+	 * defined in modules aren't supported, because late module patching
497ac3
+	 * can result in the klp relas getting applied *after* the klp module's
497ac3
+	 * jump label init.
497ac3
+	 */
497ac3
+
497ac3
+	if (lookup_symbol(lookup, key->sym, &symbol) &&
497ac3
+	    strcmp(symbol.objname, "vmlinux")) {
497ac3
+
497ac3
+		/* The static key lives in a module -- not supported */
497ac3
+
497ac3
+		/* Inert tracepoints and dynamic debug printks are harmless */
497ac3
+		if (tracepoint || dynamic_debug)
497ac3
+			return false;
497ac3
+
497ac3
+		/*
497ac3
+		 * This will be upgraded to an error after all jump label
497ac3
+		 * errors have been reported.
497ac3
+		 */
497ac3
+		log_normal("Found a jump label at %s()+0x%lx, using key %s, which is defined in a module.  Use static_key_enabled() instead.\n",
497ac3
+			   code->sym->name, code->addend, key->sym->name);
497ac3
+		jump_label_errors++;
497ac3
+		return false;
497ac3
+	}
497ac3
+
497ac3
+	/* The static key lives in vmlinux or the patch module itself */
497ac3
+
497ac3
+	/*
497ac3
+	 * If the jump label key lives in the '__dyndbg' section, make sure
497ac3
+	 * the section gets included, because we don't use klp relocs for
497ac3
+	 * dynamic debug symbols.  For an example of such a key, see
497ac3
+	 * DYNAMIC_DEBUG_BRANCH().
497ac3
+	 */
497ac3
+	if (dynamic_debug)
497ac3
+		kpatch_include_symbol(key->sym);
497ac3
+
497ac3
+	return true;
497ac3
+}
497ac3
+
497ac3
+static bool static_call_sites_group_filter(struct lookup_table *lookup,
497ac3
+					   struct section *relasec,
497ac3
+					   unsigned int group_offset,
497ac3
+					   unsigned int group_size)
497ac3
+{
497ac3
+	struct rela *code = NULL, *key = NULL, *rela;
497ac3
+	bool tracepoint = false;
497ac3
+	struct lookup_result symbol;
497ac3
+	int i = 0;
497ac3
+
497ac3
+	/*
497ac3
+	 * Here we hard-code knowledge about the contents of the jump_entry
497ac3
+	 * struct.  It has three fields: code, target, and key.  Each field has
497ac3
+	 * a relocation associated with it.
497ac3
+	 */
497ac3
+	list_for_each_entry(rela, &relasec->relas, list) {
497ac3
+		if (rela->offset >= group_offset &&
497ac3
+		    rela->offset < group_offset + group_size) {
497ac3
+			if (i == 0)
497ac3
+				code = rela;
497ac3
+			else if (i == 1)
497ac3
+				key = rela;
497ac3
+			i++;
497ac3
+		}
497ac3
+	}
497ac3
+
497ac3
+	if (i != 2 || !key || !code)
497ac3
+		ERROR("BUG: .static_call_sites has an unexpected format");
497ac3
+
497ac3
+	if (!strncmp(key->sym->name, "__SCK__tp_func_", 15))
497ac3
+		tracepoint = true;
497ac3
+
497ac3
+	/*
497ac3
+	 * Static calls are only supported in the case where the corresponding
497ac3
+	 * static call key lives in vmlinux (see explanation in
497ac3
+	 * jump_table_group_filter).
497ac3
+	 */
497ac3
+
497ac3
+	if (lookup_symbol(lookup, key->sym, &symbol) &&
497ac3
+	    strcmp(symbol.objname, "vmlinux")) {
497ac3
+
497ac3
+		/* The key lives in a module -- not supported */
497ac3
+
497ac3
+		/* Inert tracepoints are harmless */
497ac3
+		if (tracepoint)
497ac3
+			return false;
497ac3
+
497ac3
+		/*
497ac3
+		 * This will be upgraded to an error after all static call
497ac3
+		 * errors have been reported.
497ac3
+		 */
497ac3
+		log_normal("Found a static call at %s()+0x%lx, using key %s, which is defined in a module.  Use KPATCH_STATIC_CALL() instead.\n",
497ac3
+			   code->sym->name, code->addend, key->sym->name);
497ac3
+		static_call_errors++;
497ac3
+		return false;
497ac3
+	}
497ac3
+
497ac3
+	/* The key lives in vmlinux or the patch module itself */
497ac3
+	return true;
497ac3
+}
497ac3
+
497ac3
+
497ac3
 static struct special_section special_sections[] = {
497ac3
 	{
497ac3
 		.name		= "__bug_table",
497ac3
@@ -2235,6 +2403,7 @@ static struct special_section special_sections[] = {
497ac3
 		.name		= "__jump_table",
497ac3
 		.arch		= X86_64 | PPC64 | S390,
497ac3
 		.group_size	= jump_table_group_size,
497ac3
+		.group_filter	= jump_table_group_filter,
497ac3
 	},
497ac3
 	{
497ac3
 		.name		= ".printk_index",
497ac3
@@ -2260,6 +2429,7 @@ static struct special_section special_sections[] = {
497ac3
 		.name		= ".static_call_sites",
497ac3
 		.arch		= X86_64,
497ac3
 		.group_size	= static_call_sites_group_size,
497ac3
+		.group_filter	= static_call_sites_group_filter,
497ac3
 	},
497ac3
 	{
497ac3
 		.name		= ".retpoline_sites",
497ac3
@@ -2297,138 +2467,36 @@ static struct special_section special_sections[] = {
497ac3
 		.group_size	= fixup_barrier_nospec_group_size,
497ac3
 	},
497ac3
 	{
497ac3
-		.name = ".s390_return_mem",
497ac3
-		.arch = S390,
497ac3
-		.group_size = s390_expolines_group_size,
497ac3
+		.name		= ".s390_return_mem",
497ac3
+		.arch		= S390,
497ac3
+		.group_size	= s390_expolines_group_size,
497ac3
 	},
497ac3
 	{
497ac3
-		.name = ".s390_return_reg",
497ac3
-		.arch = S390,
497ac3
-		.group_size = s390_expolines_group_size,
497ac3
+		.name		= ".s390_return_reg",
497ac3
+		.arch		= S390,
497ac3
+		.group_size	= s390_expolines_group_size,
497ac3
 	},
497ac3
 	{
497ac3
-		.name = ".s390_indirect_call",
497ac3
-		.arch = S390,
497ac3
-		.group_size = s390_expolines_group_size,
497ac3
+		.name		= ".s390_indirect_call",
497ac3
+		.arch		= S390,
497ac3
+		.group_size	= s390_expolines_group_size,
497ac3
 	},
497ac3
 	{
497ac3
-		.name = ".s390_indirect_branches",
497ac3
-		.arch = S390,
497ac3
-		.group_size = s390_expolines_group_size,
497ac3
+		.name		= ".s390_indirect_branches",
497ac3
+		.arch		= S390,
497ac3
+		.group_size	= s390_expolines_group_size,
497ac3
 	},
497ac3
 	{
497ac3
-		.name = ".s390_indirect_jump",
497ac3
-		.arch = S390,
497ac3
-		.group_size = s390_expolines_group_size,
497ac3
+		.name		= ".s390_indirect_jump",
497ac3
+		.arch		= S390,
497ac3
+		.group_size	= s390_expolines_group_size,
497ac3
 	},
497ac3
 	{},
497ac3
 };
497ac3
 
497ac3
-static bool should_keep_jump_label(struct lookup_table *lookup,
497ac3
-				   struct section *relasec,
497ac3
-				   unsigned int group_offset,
497ac3
-				   unsigned int group_size,
497ac3
-				   int *jump_labels_found)
497ac3
-{
497ac3
-	struct rela *code = NULL, *key = NULL, *rela;
497ac3
-	bool tracepoint = false, dynamic_debug = false;
497ac3
-	struct lookup_result symbol;
497ac3
-	int i = 0;
497ac3
-
497ac3
-	/*
497ac3
-	 * Here we hard-code knowledge about the contents of the jump_entry
497ac3
-	 * struct.  It has three fields: code, target, and key.  Each field has
497ac3
-	 * a relocation associated with it.
497ac3
-	 */
497ac3
-	list_for_each_entry(rela, &relasec->relas, list) {
497ac3
-		if (rela->offset >= group_offset &&
497ac3
-		    rela->offset < group_offset + group_size) {
497ac3
-			if (i == 0)
497ac3
-				code = rela;
497ac3
-			else if (i == 2)
497ac3
-				key = rela;
497ac3
-			i++;
497ac3
-		}
497ac3
-	}
497ac3
-
497ac3
-	if (i != 3 || !key || !code)
497ac3
-		ERROR("BUG: __jump_table has an unexpected format");
497ac3
-
497ac3
-	if (!strncmp(key->sym->name, "__tracepoint_", 13))
497ac3
-		tracepoint = true;
497ac3
-
497ac3
-	if (is_dynamic_debug_symbol(key->sym))
497ac3
-		dynamic_debug = true;
497ac3
-
497ac3
-	if (KLP_ARCH) {
497ac3
-		/*
497ac3
-		 * On older kernels (with .klp.arch support), jump labels
497ac3
-		 * aren't supported at all.  Error out when they occur in a
497ac3
-		 * replacement function, with the exception of tracepoints and
497ac3
-		 * dynamic debug printks.  An inert tracepoint or printk is
497ac3
-		 * harmless enough, but a broken jump label can cause
497ac3
-		 * unexpected behavior.
497ac3
-		 */
497ac3
-		if (tracepoint || dynamic_debug)
497ac3
-			return false;
497ac3
-
497ac3
-		/*
497ac3
-		 * This will be upgraded to an error after all jump labels have
497ac3
-		 * been reported.
497ac3
-		 */
497ac3
-		log_normal("Found a jump label at %s()+0x%lx, using key %s.  Jump labels aren't supported with this kernel.  Use static_key_enabled() instead.\n",
497ac3
-			   code->sym->name, code->addend, key->sym->name);
497ac3
-		(*jump_labels_found)++;
497ac3
-		return false;
497ac3
-	}
497ac3
-
497ac3
-	/*
497ac3
-	 * On newer (5.8+) kernels, jump labels are supported in the case where
497ac3
-	 * the corresponding static key lives in vmlinux.  That's because such
497ac3
-	 * kernels apply vmlinux-specific .klp.rela sections at the same time
497ac3
-	 * (in the klp module load) as normal relas, before jump label init.
497ac3
-	 * On the other hand, jump labels based on static keys which are
497ac3
-	 * defined in modules aren't supported, because late module patching
497ac3
-	 * can result in the klp relas getting applied *after* the klp module's
497ac3
-	 * jump label init.
497ac3
-	 */
497ac3
-
497ac3
-	if (lookup_symbol(lookup, key->sym, &symbol) &&
497ac3
-	    strcmp(symbol.objname, "vmlinux")) {
497ac3
-
497ac3
-		/* The static key lives in a module -- not supported */
497ac3
-
497ac3
-		/* Inert tracepoints and dynamic debug printks are harmless */
497ac3
-		if (tracepoint || dynamic_debug)
497ac3
-			return false;
497ac3
-
497ac3
-		/*
497ac3
-		 * This will be upgraded to an error after all jump labels have
497ac3
-		 * been reported.
497ac3
-		 */
497ac3
-		log_normal("Found a jump label at %s()+0x%lx, using key %s, which is defined in a module.  Use static_key_enabled() instead.\n",
497ac3
-			   code->sym->name, code->addend, key->sym->name);
497ac3
-		(*jump_labels_found)++;
497ac3
-		return false;
497ac3
-	}
497ac3
-
497ac3
-	/* The static key lives in vmlinux or the patch module itself */
497ac3
-
497ac3
-	/*
497ac3
-	 * If the jump label key lives in the '__dyndbg' section, make sure
497ac3
-	 * the section gets included, because we don't use klp relocs for
497ac3
-	 * dynamic debug symbols.  For an example of such a key, see
497ac3
-	 * DYNAMIC_DEBUG_BRANCH().
497ac3
-	 */
497ac3
-	if (dynamic_debug)
497ac3
-		kpatch_include_symbol(key->sym);
497ac3
-
497ac3
-	return true;
497ac3
-}
497ac3
-
497ac3
 static bool should_keep_rela_group(struct lookup_table *lookup,
497ac3
 				   struct section *relasec, unsigned int offset,
497ac3
-				   unsigned int size, int *jump_labels_found)
497ac3
+				   unsigned int size)
497ac3
 {
497ac3
 	struct rela *rela;
497ac3
 	bool found = false;
497ac3
@@ -2448,10 +2516,6 @@ static bool should_keep_rela_group(struct lookup_table *lookup,
497ac3
 	if (!found)
497ac3
 		return false;
497ac3
 
497ac3
-	if (!strcmp(relasec->name, ".rela__jump_table"))
497ac3
-		return should_keep_jump_label(lookup, relasec, offset, size,
497ac3
-					      jump_labels_found);
497ac3
-
497ac3
 	return true;
497ac3
 }
497ac3
 
497ac3
@@ -2488,7 +2552,6 @@ static void kpatch_regenerate_special_section(struct kpatch_elf *kelf,
497ac3
 	struct rela *rela, *safe;
497ac3
 	char *src, *dest;
497ac3
 	unsigned int group_size, src_offset, dest_offset;
497ac3
-	int jump_labels_found = 0;
497ac3
 
497ac3
 	LIST_HEAD(newrelas);
497ac3
 
497ac3
@@ -2523,8 +2586,11 @@ static void kpatch_regenerate_special_section(struct kpatch_elf *kelf,
497ac3
 		if (src_offset + group_size > relasec->base->sh.sh_size)
497ac3
 			group_size = (unsigned int)(relasec->base->sh.sh_size - src_offset);
497ac3
 
497ac3
-		if (!should_keep_rela_group(lookup, relasec, src_offset, group_size,
497ac3
-					    &jump_labels_found))
497ac3
+		if (!should_keep_rela_group(lookup, relasec, src_offset, group_size))
497ac3
+			continue;
497ac3
+
497ac3
+		if (special->group_filter &&
497ac3
+		    !special->group_filter(lookup, relasec, src_offset, group_size))
497ac3
 			continue;
497ac3
 
497ac3
 		/*
497ac3
@@ -2557,9 +2623,13 @@ static void kpatch_regenerate_special_section(struct kpatch_elf *kelf,
497ac3
 		dest_offset += group_size;
497ac3
 	}
497ac3
 
497ac3
-	if (jump_labels_found)
497ac3
-		ERROR("Found %d jump label(s) in the patched code. Jump labels aren't currently supported. Use static_key_enabled() instead.",
497ac3
-		      jump_labels_found);
497ac3
+	if (jump_label_errors)
497ac3
+		ERROR("Found %d unsupported jump label(s) in the patched code. Use static_key_enabled() instead.",
497ac3
+		      jump_label_errors);
497ac3
+
497ac3
+	if (static_call_errors)
497ac3
+		ERROR("Found %d unsupported static call(s) in the patched code. Use KPATCH_STATIC_CALL() instead.",
497ac3
+		      static_call_errors);
497ac3
 
497ac3
 	if (!dest_offset) {
497ac3
 		/* no changed or global functions referenced */
497ac3
diff --git a/kpatch-build/log.h b/kpatch-build/log.h
497ac3
index eefa0fce7b08..dbdc212713e1 100644
497ac3
--- a/kpatch-build/log.h
497ac3
+++ b/kpatch-build/log.h
497ac3
@@ -9,7 +9,7 @@ extern enum loglevel loglevel;
497ac3
 extern char *childobj;
497ac3
 
497ac3
 #define ERROR(format, ...) \
497ac3
-	err(EXIT_STATUS_ERROR, "ERROR: %s: %s: %d: " format, childobj, __FUNCTION__, __LINE__, ##__VA_ARGS__)
497ac3
+	errx(EXIT_STATUS_ERROR, "ERROR: %s: %s: %d: " format, childobj, __FUNCTION__, __LINE__, ##__VA_ARGS__)
497ac3
 
497ac3
 #define log_debug(format, ...) log(DEBUG, format, ##__VA_ARGS__)
497ac3
 #define log_normal(format, ...) log(NORMAL, "%s: " format, childobj, ##__VA_ARGS__)
497ac3
-- 
497ac3
2.38.1
497ac3