From 16ba18105586882a68eeb78f9aeef78afa3fc431 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marko=20Kosti=C4=87?= Date: Fri, 23 Oct 2026 10:41:27 +0200 Subject: [PATCH] test/integration, .packit.yml: add rhel-10.3 tests MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Added rebased kernel-6.12.0-264.9.1.el10_3 tests for rhel-10.3 and invoked them trough packit. Point to the new /kernel test case. Signed-off-by: Marko Kostić --- .packit.yml | 8 +- .../rhel-10.3/data-new-LOADED.test | 3 + test/integration/rhel-10.3/data-new.patch | 20 +++ .../rhel-10.3/gcc-static-local-var-6.patch | 22 +++ .../rhel-10.3/macro-callbacks.patch | 155 ++++++++++++++++++ test/integration/rhel-10.3/module-LOADED.test | 11 ++ test/integration/rhel-10.3/module.patch | 61 +++++++ test/integration/rhel-10.3/multiple.test | 7 + test/integration/rhel-10.3/new-function.patch | 25 +++ test/integration/rhel-10.3/new-globals.patch | 35 ++++ .../rhel-10.3/shadow-newpid-LOADED.test | 3 + .../integration/rhel-10.3/shadow-newpid.patch | 75 +++++++++ .../rhel-10.3/symvers-disagreement-FAIL.patch | 24 +++ .../integration/rhel-10.3/syscall-LOADED.test | 3 + test/integration/rhel-10.3/syscall.patch | 20 +++ .../rhel-10.3/warn-detect-FAIL.patch | 9 + 16 files changed, 477 insertions(+), 4 deletions(-) create mode 100755 test/integration/rhel-10.3/data-new-LOADED.test create mode 100644 test/integration/rhel-10.3/data-new.patch create mode 100644 test/integration/rhel-10.3/gcc-static-local-var-6.patch create mode 100644 test/integration/rhel-10.3/macro-callbacks.patch create mode 100755 test/integration/rhel-10.3/module-LOADED.test create mode 100644 test/integration/rhel-10.3/module.patch create mode 100755 test/integration/rhel-10.3/multiple.test create mode 100644 test/integration/rhel-10.3/new-function.patch create mode 100644 test/integration/rhel-10.3/new-globals.patch create mode 100755 test/integration/rhel-10.3/shadow-newpid-LOADED.test create mode 100644 test/integration/rhel-10.3/shadow-newpid.patch create mode 100644 test/integration/rhel-10.3/symvers-disagreement-FAIL.patch create mode 100755 test/integration/rhel-10.3/syscall-LOADED.test create mode 100644 test/integration/rhel-10.3/syscall.patch create mode 100644 test/integration/rhel-10.3/warn-detect-FAIL.patch diff --git a/.packit.yml b/.packit.yml index 174aacf70..e92051093 100644 --- a/.packit.yml +++ b/.packit.yml @@ -39,14 +39,14 @@ _: epel-9-ppc64le: distros: [RHEL-9.7.0-Nightly, RHEL-9.6.0-Nightly, RHEL-9.4.0-Nightly, RHEL-9.2.0-Nightly, RHEL-9.0.0-Nightly] rhel+epel-10-s390x: - distros: [RHEL-10.2-Nightly] + distros: [RHEL-10.3-Nightly, RHEL-10.2-Nightly] rhel+epel-10-ppc64le: - distros: [RHEL-10.2-Nightly] + distros: [RHEL-10.3-Nightly, RHEL-10.2-Nightly] rhel+epel-10-aarch64: - distros: [RHEL-10.2-Nightly] + distros: [RHEL-10.3-Nightly, RHEL-10.2-Nightly] skip_build: true manual_trigger: false - tmt_plan: kpatch-integration-rhel + tmt_plan: kpatch-integration-rhel/kernel$ fmf_url: https://gitlab.com/redhat/centos-stream/tests/kernel/test-plans.git fmf_ref: main diff --git a/test/integration/rhel-10.3/data-new-LOADED.test b/test/integration/rhel-10.3/data-new-LOADED.test new file mode 100755 index 000000000..9f25744e6 --- /dev/null +++ b/test/integration/rhel-10.3/data-new-LOADED.test @@ -0,0 +1,3 @@ +#!/bin/bash + +grep "kpatch: 5" /proc/meminfo diff --git a/test/integration/rhel-10.3/data-new.patch b/test/integration/rhel-10.3/data-new.patch new file mode 100644 index 000000000..aa17a4f11 --- /dev/null +++ b/test/integration/rhel-10.3/data-new.patch @@ -0,0 +1,20 @@ +diff -Nupr src.orig/fs/proc/meminfo.c src/fs/proc/meminfo.c +--- src.orig/fs/proc/meminfo.c 2026-10-23 10:36:01.648053021 +0200 ++++ src/fs/proc/meminfo.c 2026-10-23 10:36:02.842864093 +0200 +@@ -31,6 +31,8 @@ static void show_val_kb(struct seq_file + seq_write(m, " kB\n", 4); + } + ++static int foo = 5; ++ + static int meminfo_proc_show(struct seq_file *m, void *v) + { + struct sysinfo i; +@@ -155,6 +157,7 @@ static int meminfo_proc_show(struct seq_ + show_val_kb(m, "CmaFree: ", + global_zone_page_state(NR_FREE_CMA_PAGES)); + #endif ++ seq_printf(m, "kpatch: %d\n", foo); + + #ifdef CONFIG_UNACCEPTED_MEMORY + show_val_kb(m, "Unaccepted: ", diff --git a/test/integration/rhel-10.3/gcc-static-local-var-6.patch b/test/integration/rhel-10.3/gcc-static-local-var-6.patch new file mode 100644 index 000000000..7ff7b1d58 --- /dev/null +++ b/test/integration/rhel-10.3/gcc-static-local-var-6.patch @@ -0,0 +1,22 @@ +diff -Nupr src.orig/net/ipv6/netfilter.c src/net/ipv6/netfilter.c +--- src.orig/net/ipv6/netfilter.c 2026-10-23 10:36:01.947307477 +0200 ++++ src/net/ipv6/netfilter.c 2026-10-23 10:36:22.761824647 +0200 +@@ -97,6 +97,8 @@ static int nf_ip6_reroute(struct sk_buff + return 0; + } + ++#include "kpatch-macros.h" ++ + int __nf_ip6_route(struct net *net, struct dst_entry **dst, + struct flowi *fl, bool strict) + { +@@ -110,6 +112,9 @@ int __nf_ip6_route(struct net *net, stru + struct dst_entry *result; + int err; + ++ if (!jiffies) ++ printk("kpatch nf_ip6_route foo\n"); ++ + result = ip6_route_output(net, sk, &fl->u.ip6); + err = result->error; + if (err) diff --git a/test/integration/rhel-10.3/macro-callbacks.patch b/test/integration/rhel-10.3/macro-callbacks.patch new file mode 100644 index 000000000..b6ac8d48f --- /dev/null +++ b/test/integration/rhel-10.3/macro-callbacks.patch @@ -0,0 +1,155 @@ +diff -Nupr src.orig/drivers/input/joydev.c src/drivers/input/joydev.c +--- src.orig/drivers/input/joydev.c 2026-10-23 10:36:01.105678244 +0200 ++++ src/drivers/input/joydev.c 2026-10-23 10:36:29.591011945 +0200 +@@ -1095,3 +1095,47 @@ static void __exit joydev_exit(void) + + module_init(joydev_init); + module_exit(joydev_exit); ++ ++#include ++#include "kpatch-macros.h" ++ ++static const char *const module_state[] = { ++ [MODULE_STATE_LIVE] = "[MODULE_STATE_LIVE] Normal state", ++ [MODULE_STATE_COMING] = "[MODULE_STATE_COMING] Full formed, running module_init", ++ [MODULE_STATE_GOING] = "[MODULE_STATE_GOING] Going away", ++ [MODULE_STATE_UNFORMED] = "[MODULE_STATE_UNFORMED] Still setting it up", ++}; ++ ++static void callback_info(const char *callback, patch_object *obj) ++{ ++ if (obj->mod) ++ pr_info("%s: %s -> %s\n", callback, obj->mod->name, ++ module_state[obj->mod->state]); ++ else ++ pr_info("%s: vmlinux\n", callback); ++} ++ ++static int pre_patch_callback(patch_object *obj) ++{ ++ callback_info(__func__, obj); ++ return 0; /* return -ENODEV; */ ++} ++KPATCH_PRE_PATCH_CALLBACK(pre_patch_callback); ++ ++static void post_patch_callback(patch_object *obj) ++{ ++ callback_info(__func__, obj); ++} ++KPATCH_POST_PATCH_CALLBACK(post_patch_callback); ++ ++static void pre_unpatch_callback(patch_object *obj) ++{ ++ callback_info(__func__, obj); ++} ++KPATCH_PRE_UNPATCH_CALLBACK(pre_unpatch_callback); ++ ++static void post_unpatch_callback(patch_object *obj) ++{ ++ callback_info(__func__, obj); ++} ++KPATCH_POST_UNPATCH_CALLBACK(post_unpatch_callback); +diff -Nupr src.orig/drivers/input/misc/pcspkr.c src/drivers/input/misc/pcspkr.c +--- src.orig/drivers/input/misc/pcspkr.c 2026-10-23 10:36:01.108713954 +0200 ++++ src/drivers/input/misc/pcspkr.c 2026-10-23 10:36:29.592359331 +0200 +@@ -132,3 +132,46 @@ static struct platform_driver pcspkr_pla + }; + module_platform_driver(pcspkr_platform_driver); + ++#include ++#include "kpatch-macros.h" ++ ++static const char *const module_state[] = { ++ [MODULE_STATE_LIVE] = "[MODULE_STATE_LIVE] Normal state", ++ [MODULE_STATE_COMING] = "[MODULE_STATE_COMING] Full formed, running module_init", ++ [MODULE_STATE_GOING] = "[MODULE_STATE_GOING] Going away", ++ [MODULE_STATE_UNFORMED] = "[MODULE_STATE_UNFORMED] Still setting it up", ++}; ++ ++static void callback_info(const char *callback, patch_object *obj) ++{ ++ if (obj->mod) ++ pr_info("%s: %s -> %s\n", callback, obj->mod->name, ++ module_state[obj->mod->state]); ++ else ++ pr_info("%s: vmlinux\n", callback); ++} ++ ++static int pre_patch_callback(patch_object *obj) ++{ ++ callback_info(__func__, obj); ++ return 0; ++} ++KPATCH_PRE_PATCH_CALLBACK(pre_patch_callback); ++ ++static void post_patch_callback(patch_object *obj) ++{ ++ callback_info(__func__, obj); ++} ++KPATCH_POST_PATCH_CALLBACK(post_patch_callback); ++ ++static void pre_unpatch_callback(patch_object *obj) ++{ ++ callback_info(__func__, obj); ++} ++KPATCH_PRE_UNPATCH_CALLBACK(pre_unpatch_callback); ++ ++static void post_unpatch_callback(patch_object *obj) ++{ ++ callback_info(__func__, obj); ++} ++KPATCH_POST_UNPATCH_CALLBACK(post_unpatch_callback); +diff -Nupr src.orig/fs/aio.c src/fs/aio.c +--- src.orig/fs/aio.c 2026-10-23 10:36:01.612002499 +0200 ++++ src/fs/aio.c 2026-10-23 10:36:29.593347240 +0200 +@@ -50,6 +50,50 @@ + + #define KIOCB_KEY 0 + ++#include ++#include "kpatch-macros.h" ++ ++static const char *const module_state[] = { ++ [MODULE_STATE_LIVE] = "[MODULE_STATE_LIVE] Normal state", ++ [MODULE_STATE_COMING] = "[MODULE_STATE_COMING] Full formed, running module_init", ++ [MODULE_STATE_GOING] = "[MODULE_STATE_GOING] Going away", ++ [MODULE_STATE_UNFORMED] = "[MODULE_STATE_UNFORMED] Still setting it up", ++}; ++ ++static void callback_info(const char *callback, patch_object *obj) ++{ ++ if (obj->mod) ++ pr_info("%s: %s -> %s\n", callback, obj->mod->name, ++ module_state[obj->mod->state]); ++ else ++ pr_info("%s: vmlinux\n", callback); ++} ++ ++static int pre_patch_callback(patch_object *obj) ++{ ++ callback_info(__func__, obj); ++ return 0; ++} ++KPATCH_PRE_PATCH_CALLBACK(pre_patch_callback); ++ ++static void post_patch_callback(patch_object *obj) ++{ ++ callback_info(__func__, obj); ++} ++KPATCH_POST_PATCH_CALLBACK(post_patch_callback); ++ ++static void pre_unpatch_callback(patch_object *obj) ++{ ++ callback_info(__func__, obj); ++} ++KPATCH_PRE_UNPATCH_CALLBACK(pre_unpatch_callback); ++ ++static void post_unpatch_callback(patch_object *obj) ++{ ++ callback_info(__func__, obj); ++} ++KPATCH_POST_UNPATCH_CALLBACK(post_unpatch_callback); ++ + #define AIO_RING_MAGIC 0xa10a10a1 + #define AIO_RING_COMPAT_FEATURES 1 + #define AIO_RING_INCOMPAT_FEATURES 0 diff --git a/test/integration/rhel-10.3/module-LOADED.test b/test/integration/rhel-10.3/module-LOADED.test new file mode 100755 index 000000000..bed43ca52 --- /dev/null +++ b/test/integration/rhel-10.3/module-LOADED.test @@ -0,0 +1,11 @@ +#!/bin/bash + +set -o errexit + +sudo modprobe xfs +sleep 5 +grep -q kpatch /sys/fs/xfs/stats/stats +# TODO: This will trigger a printk on newer kernels which have the .klp.arch +# removal. Don't actually do the grep until running on a newer kernel. +echo "file fs/xfs/xfs_stats.c +p" > /sys/kernel/debug/dynamic_debug/control +# dmesg | grep -q "kpatch: pr_debug" diff --git a/test/integration/rhel-10.3/module.patch b/test/integration/rhel-10.3/module.patch new file mode 100644 index 000000000..19ac015bd --- /dev/null +++ b/test/integration/rhel-10.3/module.patch @@ -0,0 +1,61 @@ +diff -Nupr src.orig/fs/xfs/xfs_stats.c src/fs/xfs/xfs_stats.c +--- src.orig/fs/xfs/xfs_stats.c 2026-10-23 10:36:01.663713900 +0200 ++++ src/fs/xfs/xfs_stats.c 2026-10-23 10:36:33.995381284 +0200 +@@ -16,6 +16,8 @@ static int counter_val(struct xfsstats _ + return val; + } + ++extern char *kpatch_string(void); ++ + int xfs_stats_format(struct xfsstats __percpu *stats, char *buf) + { + int i, j; +@@ -90,6 +92,34 @@ int xfs_stats_format(struct xfsstats __p + 0); + #endif + ++ /* Reference a symbol outside the .o yet inside the patch module: */ ++ len += scnprintf(buf + len, PATH_MAX-len, "%s\n", kpatch_string()); ++ ++#ifdef CONFIG_X86_64 ++ /* Test alternatives patching: */ ++ alternative("ud2", "nop", X86_FEATURE_ALWAYS); ++ alternative("nop", "ud2", X86_FEATURE_IA64); ++ ++ /* Test paravirt patching: */ ++ slow_down_io(); /* paravirt call */ ++#endif ++ ++ /* Test pr_debug: */ ++ pr_debug("kpatch: pr_debug() test\n"); ++ ++{ ++ /* Test static branches: */ ++ static DEFINE_STATIC_KEY_TRUE(kpatch_key); ++ ++ if (static_branch_unlikely(&memcg_kmem_online_key)) ++ printk("kpatch: memcg_kmem_online_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); ++} ++ + return len; + } + +diff -Nupr src.orig/net/netlink/af_netlink.c src/net/netlink/af_netlink.c +--- src.orig/net/netlink/af_netlink.c 2026-10-23 10:36:01.959994249 +0200 ++++ src/net/netlink/af_netlink.c 2026-10-23 10:36:33.995710743 +0200 +@@ -2964,4 +2964,10 @@ panic: + panic("netlink_init: Cannot allocate nl_table\n"); + } + ++char *kpatch_string(void); ++char *kpatch_string(void) ++{ ++ return "kpatch"; ++} ++ + core_initcall(netlink_proto_init); diff --git a/test/integration/rhel-10.3/multiple.test b/test/integration/rhel-10.3/multiple.test new file mode 100755 index 000000000..7e4b3525c --- /dev/null +++ b/test/integration/rhel-10.3/multiple.test @@ -0,0 +1,7 @@ +#!/bin/bash + +SCRIPTDIR="$(readlink -f $(dirname $(type -p $0)))" + +declare -a blacklist=(meminfo-string-LOADED.test) + +source ${SCRIPTDIR}/../common/multiple.template diff --git a/test/integration/rhel-10.3/new-function.patch b/test/integration/rhel-10.3/new-function.patch new file mode 100644 index 000000000..2d75d2191 --- /dev/null +++ b/test/integration/rhel-10.3/new-function.patch @@ -0,0 +1,25 @@ +diff -Nupr src.orig/drivers/tty/n_tty.c src/drivers/tty/n_tty.c +--- src.orig/drivers/tty/n_tty.c 2026-10-23 10:36:01.563645759 +0200 ++++ src/drivers/tty/n_tty.c 2026-10-23 10:36:36.999710449 +0200 +@@ -2355,7 +2355,7 @@ more_to_be_read: + * (note that the process_output*() functions take this lock themselves) + */ + +-static ssize_t n_tty_write(struct tty_struct *tty, struct file *file, ++static ssize_t noinline kpatch_n_tty_write(struct tty_struct *tty, struct file *file, + const u8 *buf, size_t nr) + { + const u8 *b = buf; +@@ -2440,6 +2440,12 @@ break_out: + return (b - buf) ? b - buf : retval; + } + ++static ssize_t __attribute__((optimize("-fno-optimize-sibling-calls"))) n_tty_write(struct tty_struct *tty, struct file *file, ++ const unsigned char *buf, size_t nr) ++{ ++ return kpatch_n_tty_write(tty, file, buf, nr); ++} ++ + /** + * n_tty_poll - poll method for N_TTY + * @tty: terminal device diff --git a/test/integration/rhel-10.3/new-globals.patch b/test/integration/rhel-10.3/new-globals.patch new file mode 100644 index 000000000..184e58bbd --- /dev/null +++ b/test/integration/rhel-10.3/new-globals.patch @@ -0,0 +1,35 @@ +diff -Nupr src.orig/fs/proc/cmdline.c src/fs/proc/cmdline.c +--- src.orig/fs/proc/cmdline.c 2026-10-23 10:36:01.648053021 +0200 ++++ src/fs/proc/cmdline.c 2026-10-23 10:36:40.017873335 +0200 +@@ -22,3 +22,11 @@ static int __init proc_cmdline_init(void + return 0; + } + fs_initcall(proc_cmdline_init); ++ ++#include ++void kpatch_print_message(void); ++void kpatch_print_message(void) ++{ ++ if (!jiffies) ++ printk("hello there!\n"); ++} +diff -Nupr src.orig/fs/proc/meminfo.c src/fs/proc/meminfo.c +--- src.orig/fs/proc/meminfo.c 2026-10-23 10:36:01.648053021 +0200 ++++ src/fs/proc/meminfo.c 2026-10-23 10:36:40.018747840 +0200 +@@ -21,6 +21,8 @@ + #include + #include "internal.h" + ++void kpatch_print_message(void); ++ + void __attribute__((weak)) arch_report_meminfo(struct seq_file *m) + { + } +@@ -57,6 +59,7 @@ static int meminfo_proc_show(struct seq_ + sreclaimable = global_node_page_state_pages(NR_SLAB_RECLAIMABLE_B); + sunreclaim = global_node_page_state_pages(NR_SLAB_UNRECLAIMABLE_B); + ++ kpatch_print_message(); + show_val_kb(m, "MemTotal: ", i.totalram); + show_val_kb(m, "MemFree: ", i.freeram); + show_val_kb(m, "MemAvailable: ", available); diff --git a/test/integration/rhel-10.3/shadow-newpid-LOADED.test b/test/integration/rhel-10.3/shadow-newpid-LOADED.test new file mode 100755 index 000000000..c07d11205 --- /dev/null +++ b/test/integration/rhel-10.3/shadow-newpid-LOADED.test @@ -0,0 +1,3 @@ +#!/bin/bash + +grep -q newpid: /proc/$$/status diff --git a/test/integration/rhel-10.3/shadow-newpid.patch b/test/integration/rhel-10.3/shadow-newpid.patch new file mode 100644 index 000000000..66aa2a70f --- /dev/null +++ b/test/integration/rhel-10.3/shadow-newpid.patch @@ -0,0 +1,75 @@ +diff -Nupr src.orig/fs/proc/array.c src/fs/proc/array.c +--- src.orig/fs/proc/array.c 2026-10-23 10:36:01.648053021 +0200 ++++ src/fs/proc/array.c 2026-10-23 10:36:43.135723148 +0200 +@@ -395,12 +395,19 @@ static inline void task_seccomp(struct s + seq_putc(m, '\n'); + } + ++#include + static inline void task_context_switch_counts(struct seq_file *m, + struct task_struct *p) + { ++ int *newpid; ++ + seq_put_decimal_ull(m, "voluntary_ctxt_switches:\t", p->nvcsw); + seq_put_decimal_ull(m, "\nnonvoluntary_ctxt_switches:\t", p->nivcsw); + seq_putc(m, '\n'); ++ ++ newpid = klp_shadow_get(p, 0); ++ if (newpid) ++ seq_printf(m, "newpid:\t%d\n", *newpid); + } + + static void task_cpus_allowed(struct seq_file *m, struct task_struct *task) +diff -Nupr src.orig/kernel/exit.c src/kernel/exit.c +--- src.orig/kernel/exit.c 2026-10-23 10:36:01.900147794 +0200 ++++ src/kernel/exit.c 2026-10-23 10:36:43.136563002 +0200 +@@ -883,6 +883,7 @@ static void synchronize_group_exit(struc + spin_unlock_irq(&sighand->siglock); + } + ++#include + void __noreturn do_exit(long code) + { + struct task_struct *tsk = current; +@@ -960,6 +961,8 @@ void __noreturn do_exit(long code) + sched_autogroup_exit_task(tsk); + cgroup_exit(tsk); + ++ klp_shadow_free(tsk, 0, NULL); ++ + /* + * FIXME: do that only when needed, using sched_exit tracepoint + */ +diff -Nupr src.orig/kernel/fork.c src/kernel/fork.c +--- src.orig/kernel/fork.c 2026-10-23 10:36:01.900147794 +0200 ++++ src/kernel/fork.c 2026-10-23 10:36:43.137727419 +0200 +@@ -2554,6 +2554,7 @@ struct task_struct *create_io_thread(int + * + * args->exit_signal is expected to be checked for sanity by the caller. + */ ++#include + pid_t kernel_clone(struct kernel_clone_args *args) + { + u64 clone_flags = args->flags; +@@ -2562,6 +2563,8 @@ pid_t kernel_clone(struct kernel_clone_a + struct task_struct *p; + int trace = 0; + pid_t nr; ++ int *newpid; ++ static int ctr = 0; + + /* + * For legacy clone() calls, CLONE_PIDFD uses the parent_tid argument +@@ -2601,6 +2604,11 @@ pid_t kernel_clone(struct kernel_clone_a + if (IS_ERR(p)) + return PTR_ERR(p); + ++ newpid = klp_shadow_get_or_alloc(p, 0, sizeof(*newpid), GFP_KERNEL, ++ NULL, NULL); ++ if (newpid) ++ *newpid = ctr++; ++ + /* + * Do this prior waking up the new thread - the thread pointer + * might get invalid after that point, if the thread exits quickly. diff --git a/test/integration/rhel-10.3/symvers-disagreement-FAIL.patch b/test/integration/rhel-10.3/symvers-disagreement-FAIL.patch new file mode 100644 index 000000000..5b77d66eb --- /dev/null +++ b/test/integration/rhel-10.3/symvers-disagreement-FAIL.patch @@ -0,0 +1,24 @@ +diff -Nupr src.orig/drivers/base/core.c src/drivers/base/core.c +--- src.orig/drivers/base/core.c 2026-10-23 10:36:00.758295865 +0200 ++++ src/drivers/base/core.c 2026-10-23 10:36:46.244709546 +0200 +@@ -37,6 +37,8 @@ + #include "physical_location.h" + #include "power/power.h" + ++#include ++ + /* Device links support. */ + static LIST_HEAD(deferred_sync); + static unsigned int defer_sync_state_count = 1; +diff -Nupr src.orig/drivers/usb/core/usb.c src/drivers/usb/core/usb.c +--- src.orig/drivers/usb/core/usb.c 2026-10-23 10:36:01.571150337 +0200 ++++ src/drivers/usb/core/usb.c 2026-10-23 10:36:46.248252573 +0200 +@@ -771,6 +771,8 @@ EXPORT_SYMBOL_GPL(usb_alloc_dev); + */ + struct usb_device *usb_get_dev(struct usb_device *dev) + { ++ barrier(); ++ + if (dev) + get_device(&dev->dev); + return dev; diff --git a/test/integration/rhel-10.3/syscall-LOADED.test b/test/integration/rhel-10.3/syscall-LOADED.test new file mode 100755 index 000000000..3a2fd88e0 --- /dev/null +++ b/test/integration/rhel-10.3/syscall-LOADED.test @@ -0,0 +1,3 @@ +#!/bin/bash + +uname -s | grep -q kpatch diff --git a/test/integration/rhel-10.3/syscall.patch b/test/integration/rhel-10.3/syscall.patch new file mode 100644 index 000000000..63f821448 --- /dev/null +++ b/test/integration/rhel-10.3/syscall.patch @@ -0,0 +1,20 @@ +diff -Nupr src.orig/kernel/sys.c src/kernel/sys.c +--- src.orig/kernel/sys.c 2026-10-23 10:36:01.907713876 +0200 ++++ src/kernel/sys.c 2026-10-23 10:36:49.301092092 +0200 +@@ -1315,13 +1315,15 @@ static int override_release(char __user + return ret; + } + +-SYSCALL_DEFINE1(newuname, struct new_utsname __user *, name) ++#include "kpatch-syscall.h" ++KPATCH_SYSCALL_DEFINE1(newuname, struct new_utsname __user *, name) + { + struct new_utsname tmp; + + down_read(&uts_sem); + memcpy(&tmp, utsname(), sizeof(tmp)); + up_read(&uts_sem); ++ strcat(tmp.sysname, ".kpatch"); + if (copy_to_user(name, &tmp, sizeof(tmp))) + return -EFAULT; + diff --git a/test/integration/rhel-10.3/warn-detect-FAIL.patch b/test/integration/rhel-10.3/warn-detect-FAIL.patch new file mode 100644 index 000000000..db312369b --- /dev/null +++ b/test/integration/rhel-10.3/warn-detect-FAIL.patch @@ -0,0 +1,9 @@ +diff -Nupr src.orig/arch/x86/kvm/x86.c src/arch/x86/kvm/x86.c +--- src.orig/arch/x86/kvm/x86.c 2026-10-23 10:36:00.665832291 +0200 ++++ src/arch/x86/kvm/x86.c 2026-10-23 10:36:52.265708958 +0200 +@@ -1,4 +1,5 @@ + // SPDX-License-Identifier: GPL-2.0-only ++ + /* + * Kernel-based Virtual Machine driver for Linux + *