mirror of
https://github.com/dynup/kpatch
synced 2025-02-18 02:37:01 +00:00
Patches rebased against RHEL-8.2 GA kernel-4.18.0-193.el8. Tests disabled for errors when building against updated 4.18.0-193.3.1.el8_2.x86_64 z-stream kernel: * data-read-mostly.patch: dev.o: Found a jump label at __netif_receive_skb_core()+0x32, using key netstamp_needed_key. Jump labels aren't supported with this kernel. Use static_key_enabled() instead. dev.o: Found a jump label at __netif_receive_skb_core()+0x95, using key generic_xdp_needed_key. Jump labels aren't supported with this kernel. Use static_key_enabled() instead. dev.o: Found a jump label at __netif_receive_skb_core()+0xd0, using key ingress_needed_key. Jump labels aren't supported with this kernel. Use static_key_enabled() instead. dev.o: Found a jump label at __netif_receive_skb_core()+0x412, using key nf_hooks_needed. Jump labels aren't supported with this kernel. Use static_key_enabled() instead. /root/github-kpatch/kpatch-build/create-diff-object: ERROR: dev.o: kpatch_regenerate_special_section: 2344: Found 4 jump label(s) in the patched code. Jump labels aren't currently supported. Use static_key_enabled() instead. * gcc-static-local-var-4.patch (ppc64le only): aio.o: Found a jump label at aio_free_ring()+0x7c, using key devmap_managed_key. Jump labels aren't supported with this kernel. Use static_key_enabled() instead. /root/github-kpatch/kpatch-build/create-diff-object: ERROR: aio.o: kpatch_regenerate_special_section: 2344: Found 1 jump label(s) in the patched code. Jump labels aren't currently supported. Use static_key_enabled() instead. * shadow-newpid.patch: fork.o: WARNING: unable to correlate static local variable ctr.70325 used by _do_fork, assuming variable is new fork.o: changed function: _do_fork exit.o: Found a jump label at do_exit()+0x6d3, using key devmap_managed_key. Jump labels aren't supported with this kernel. Use static_key_enabled() instead. /root/github-kpatch/kpatch-build/create-diff-object: ERROR: exit.o: kpatch_regenerate_special_section: 2344: Found 1 jump label(s) in the patched code. Jump labels aren't currently supported. Use static_key_enabled() instead. * special-static.patch: fork.o: Found a jump label at copy_process.part.34()+0x1fc, using key memcg_kmem_enabled_key. Jump labels aren't supported with this kernel. Use static_key_enabled() instead. fork.o: Found a jump label at copy_process.part.34()+0x21b, using key memory_cgrp_subsys_enabled_key. Jump labels aren't supported with this kernel. Use static_key_enabled() instead. fork.o: Found a jump label at copy_process.part.34()+0x72a, using key memory_cgrp_subsys_enabled_key. Jump labels aren't supported with this kernel. Use static_key_enabled() instead. fork.o: Found a jump label at copy_process.part.34()+0x773, using key memcg_kmem_enabled_key. Jump labels aren't supported with this kernel. Use static_key_enabled() instead ./root/github-kpatch/kpatch-build/create-diff-object: ERROR: fork.o: kpatch_regenerate_special_section: 2344: Found 4 jump label(s) in the patched code. Jump labels aren't currently supported. Use static_key_enabled() instead. Signed-off-by: Joe Lawrence <joe.lawrence@redhat.com>
86 lines
2.5 KiB
Diff
86 lines
2.5 KiB
Diff
From 08078d00ab1749a6f84148a00d8d26572af4ec97 Mon Sep 17 00:00:00 2001
|
|
Message-Id: <08078d00ab1749a6f84148a00d8d26572af4ec97.1586900628.git.jpoimboe@redhat.com>
|
|
From: Josh Poimboeuf <jpoimboe@redhat.com>
|
|
Date: Tue, 14 Apr 2020 15:17:51 -0500
|
|
Subject: [PATCH] kpatch module integration test
|
|
|
|
This tests several things related to the patching of modules:
|
|
|
|
- 'kpatch_string' tests the referencing of a symbol which is outside the
|
|
.o, but inside the patch module.
|
|
|
|
- alternatives patching (.altinstructions)
|
|
|
|
- paravirt patching (.parainstructions)
|
|
|
|
- jump labels (5.8+ kernels only) -- including dynamic printk
|
|
|
|
Signed-off-by: Josh Poimboeuf <jpoimboe@redhat.com>
|
|
---
|
|
fs/nfsd/export.c | 30 ++++++++++++++++++++++++++++++
|
|
net/netlink/af_netlink.c | 5 +++++
|
|
2 files changed, 35 insertions(+)
|
|
|
|
diff -Nupr src.orig/fs/nfsd/export.c src/fs/nfsd/export.c
|
|
--- src.orig/fs/nfsd/export.c 2020-05-12 11:14:29.230792719 -0400
|
|
+++ src/fs/nfsd/export.c 2020-05-12 11:15:17.078719042 -0400
|
|
@@ -1196,15 +1196,45 @@ static void exp_flags(struct seq_file *m
|
|
}
|
|
}
|
|
|
|
+#include <linux/version.h>
|
|
+extern char *kpatch_string(void);
|
|
+
|
|
static int e_show(struct seq_file *m, void *p)
|
|
{
|
|
struct cache_head *cp = p;
|
|
struct svc_export *exp = container_of(cp, struct svc_export, h);
|
|
struct cache_detail *cd = m->private;
|
|
+#ifdef CONFIG_X86_64
|
|
+ unsigned long long sched_clock;
|
|
+
|
|
+ alternative("ud2", "call yield", X86_FEATURE_ALWAYS);
|
|
+ alternative("call yield", "ud2", X86_FEATURE_IA64);
|
|
+
|
|
+ sched_clock = paravirt_sched_clock();
|
|
+ if (!jiffies)
|
|
+ printk("kpatch: sched_clock: %llu\n", sched_clock);
|
|
+#endif
|
|
+
|
|
+ pr_debug("kpatch: pr_debug() test\n");
|
|
+
|
|
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(5, 8, 0)
|
|
+{
|
|
+ static DEFINE_STATIC_KEY_TRUE(kpatch_key);
|
|
+
|
|
+ if (static_branch_unlikely(&mcsafe_key))
|
|
+ printk("kpatch: mcsafe_key\n");
|
|
+
|
|
+ BUG_ON(!static_branch_likely(&kpatch_key));
|
|
+ static_branch_disable(&kpatch_key);
|
|
+ BUG_ON(static_branch_likely(&kpatch_key));
|
|
+ static_branch_enable(&kpatch_key);
|
|
+}
|
|
+#endif
|
|
|
|
if (p == SEQ_START_TOKEN) {
|
|
seq_puts(m, "# Version 1.1\n");
|
|
seq_puts(m, "# Path Client(Flags) # IPs\n");
|
|
+ seq_puts(m, kpatch_string());
|
|
return 0;
|
|
}
|
|
|
|
diff -Nupr src.orig/net/netlink/af_netlink.c src/net/netlink/af_netlink.c
|
|
--- src.orig/net/netlink/af_netlink.c 2020-05-12 11:14:29.780768884 -0400
|
|
+++ src/net/netlink/af_netlink.c 2020-05-12 11:15:17.078719042 -0400
|
|
@@ -2788,4 +2788,9 @@ panic:
|
|
panic("netlink_init: Cannot allocate nl_table\n");
|
|
}
|
|
|
|
+char *kpatch_string(void)
|
|
+{
|
|
+ return "# kpatch\n";
|
|
+}
|
|
+
|
|
core_initcall(netlink_proto_init);
|