-
Notifications
You must be signed in to change notification settings - Fork 338
Add integration tests for RHEL-9.6 release #1453
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
joe-lawrence
merged 2 commits into
dynup:master
from
joe-lawrence:integration-tests-kernel-5.14.0-570.12.1.el9
May 6, 2025
Merged
Changes from all commits
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,3 @@ | ||
| #!/bin/bash | ||
|
|
||
| grep "kpatch: 5" /proc/meminfo |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,20 @@ | ||
| diff -Nupr src.orig/fs/proc/meminfo.c src/fs/proc/meminfo.c | ||
| --- src.orig/fs/proc/meminfo.c 2025-04-24 15:16:40.495334555 -0400 | ||
| +++ src/fs/proc/meminfo.c 2025-04-24 15:16:41.723798914 -0400 | ||
| @@ -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; | ||
| @@ -158,6 +160,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: ", |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,22 @@ | ||
| diff -Nupr src.orig/net/ipv6/netfilter.c src/net/ipv6/netfilter.c | ||
| --- src.orig/net/ipv6/netfilter.c 2025-04-24 15:16:40.845627279 -0400 | ||
| +++ src/net/ipv6/netfilter.c 2025-04-24 15:16:53.900861064 -0400 | ||
| @@ -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) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,155 @@ | ||
| diff -Nupr src.orig/drivers/input/joydev.c src/drivers/input/joydev.c | ||
| --- src.orig/drivers/input/joydev.c 2025-04-24 15:16:39.916683131 -0400 | ||
| +++ src/drivers/input/joydev.c 2025-04-24 15:16:57.646039868 -0400 | ||
| @@ -1096,3 +1096,47 @@ static void __exit joydev_exit(void) | ||
|
|
||
| module_init(joydev_init); | ||
| module_exit(joydev_exit); | ||
| + | ||
| +#include <linux/module.h> | ||
| +#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 2025-04-24 15:16:39.920734332 -0400 | ||
| +++ src/drivers/input/misc/pcspkr.c 2025-04-24 15:16:57.647011647 -0400 | ||
| @@ -134,3 +134,46 @@ static struct platform_driver pcspkr_pla | ||
| }; | ||
| module_platform_driver(pcspkr_platform_driver); | ||
|
|
||
| +#include <linux/module.h> | ||
| +#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 2025-04-24 15:16:40.459126239 -0400 | ||
| +++ src/fs/aio.c 2025-04-24 15:16:57.647442356 -0400 | ||
| @@ -50,6 +50,50 @@ | ||
|
|
||
| #define KIOCB_KEY 0 | ||
|
|
||
| +#include <linux/module.h> | ||
| +#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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,13 @@ | ||
| #!/bin/bash | ||
|
|
||
| set -o errexit | ||
|
|
||
| sudo modprobe nfsd | ||
| sleep 5 | ||
| grep -q kpatch /proc/fs/nfs/exports | ||
|
|
||
| # 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/nfsd/export.c +p" > /sys/kernel/debug/dynamic_debug/control | ||
| cat /proc/fs/nfs/exports > /dev/null | ||
| # dmesg | grep -q "kpatch: pr_debug" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,64 @@ | ||
| diff -Nupr src.orig/fs/nfsd/export.c src/fs/nfsd/export.c | ||
| --- src.orig/fs/nfsd/export.c 2025-04-24 15:16:40.485060345 -0400 | ||
| +++ src/fs/nfsd/export.c 2025-04-24 15:17:01.378772306 -0400 | ||
| @@ -1356,6 +1356,10 @@ static void exp_flags(struct seq_file *m | ||
| } | ||
| } | ||
|
|
||
| +#include <linux/version.h> | ||
| +extern char *kpatch_string(void); | ||
| + | ||
| +__attribute__((optimize("-fno-optimize-sibling-calls"))) | ||
| static int e_show(struct seq_file *m, void *p) | ||
| { | ||
| struct cache_head *cp = p; | ||
| @@ -1363,12 +1367,36 @@ static int e_show(struct seq_file *m, vo | ||
| struct cache_detail *cd = m->private; | ||
| bool export_stats = is_export_stats_file(m); | ||
|
|
||
| +#ifdef CONFIG_X86_64 | ||
| + alternative("ud2", "call single_task_running", X86_FEATURE_ALWAYS); | ||
| + alternative("call single_task_running", "ud2", X86_FEATURE_IA64); | ||
| + | ||
| + slow_down_io(); /* paravirt call */ | ||
| +#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(&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); | ||
| +} | ||
| +#endif | ||
| + | ||
| if (p == SEQ_START_TOKEN) { | ||
| seq_puts(m, "# Version 1.1\n"); | ||
| if (export_stats) | ||
| seq_puts(m, "# Path Client Start-time\n#\tStats\n"); | ||
| else | ||
| 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 2025-04-24 15:16:40.863933420 -0400 | ||
| +++ src/net/netlink/af_netlink.c 2025-04-24 15:17:01.380243740 -0400 | ||
| @@ -2943,4 +2943,9 @@ panic: | ||
| panic("netlink_init: Cannot allocate nl_table\n"); | ||
| } | ||
|
|
||
| +char *kpatch_string(void) | ||
| +{ | ||
| + return "# kpatch\n"; | ||
| +} | ||
| + | ||
| core_initcall(netlink_proto_init); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,34 @@ | ||
| diff -Nupr src.orig/fs/proc/cmdline.c src/fs/proc/cmdline.c | ||
| --- src.orig/fs/proc/cmdline.c 2025-04-24 15:16:40.495334555 -0400 | ||
| +++ src/fs/proc/cmdline.c 2025-04-24 15:17:05.071282580 -0400 | ||
| @@ -17,3 +17,10 @@ static int __init proc_cmdline_init(void | ||
| return 0; | ||
| } | ||
| fs_initcall(proc_cmdline_init); | ||
| + | ||
| +#include <linux/printk.h> | ||
| +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 2025-04-24 15:16:40.495334555 -0400 | ||
| +++ src/fs/proc/meminfo.c 2025-04-24 15:17:05.071704632 -0400 | ||
| @@ -21,6 +21,8 @@ | ||
| #include <asm/page.h> | ||
| #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); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,3 @@ | ||
| #!/bin/bash | ||
|
|
||
| grep -q newpid: /proc/$$/status |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@jpoimboe : how did we miss this in the review 😆 ? I think I was so annoyed about not being able to combine
defined(X) ... Xon a single line that I botched the rest.