test/integration/rhel-9.0: remove obsolete tests

Clean out any integration tests that no longer exercise their original
use cases.

Suggested-by: Josh Poimboeuf <jpoimboe@redhat.com>
Signed-off-by: Joe Lawrence <joe.lawrence@redhat.com>
This commit is contained in:
Joe Lawrence 2022-05-06 14:42:11 -04:00
parent dc1d49a142
commit 4774d070d2
20 changed files with 0 additions and 457 deletions

View File

@ -1,12 +0,0 @@
diff -Nupr src.orig/fs/proc/proc_sysctl.c src/fs/proc/proc_sysctl.c
--- src.orig/fs/proc/proc_sysctl.c 2022-04-29 15:52:13.400335767 -0400
+++ src/fs/proc/proc_sysctl.c 2022-04-29 15:52:14.157338461 -0400
@@ -302,6 +302,8 @@ static void start_unregistering(struct c
static struct ctl_table_header *sysctl_head_grab(struct ctl_table_header *head)
{
+ if (jiffies == 0)
+ printk("kpatch-test: testing __bug_table section changes\n");
BUG_ON(!head);
spin_lock(&sysctl_lock);
if (!use_table(head))

View File

@ -1,3 +0,0 @@
#!/bin/bash
grep kpatch=1 /proc/cmdline

View File

@ -1,13 +0,0 @@
diff -Nupr src.orig/fs/proc/cmdline.c src/fs/proc/cmdline.c
--- src.orig/fs/proc/cmdline.c 2022-04-29 15:52:13.399335763 -0400
+++ src/fs/proc/cmdline.c 2022-04-29 15:52:17.041348724 -0400
@@ -6,8 +6,7 @@
static int cmdline_proc_show(struct seq_file *m, void *v)
{
- seq_puts(m, saved_command_line);
- seq_putc(m, '\n');
+ seq_printf(m, "%s kpatch=1\n", saved_command_line);
return 0;
}

View File

@ -1,11 +0,0 @@
diff -Nupr src.orig/net/core/dev.c src/net/core/dev.c
--- src.orig/net/core/dev.c 2022-04-29 15:52:13.627336575 -0400
+++ src/net/core/dev.c 2022-04-29 15:52:22.819369286 -0400
@@ -5405,6 +5405,7 @@ skip_classify:
case RX_HANDLER_PASS:
break;
default:
+ printk("BUG!\n");
BUG();
}
}

View File

@ -1,11 +0,0 @@
diff -Nupr src.orig/fs/readdir.c src/fs/readdir.c
--- src.orig/fs/readdir.c 2022-04-29 15:52:13.347335578 -0400
+++ src/fs/readdir.c 2022-04-29 15:52:25.604379197 -0400
@@ -245,6 +245,7 @@ static int filldir(struct dir_context *c
if (prev_reclen && signal_pending(current))
return -EINTR;
dirent = buf->current_dir;
+ asm("nop");
prev = (void __user *) dirent - prev_reclen;
if (!user_write_access_begin(prev, reclen + prev_reclen))
goto efault;

View File

@ -1,11 +0,0 @@
diff -Nupr src.orig/fs/proc/proc_sysctl.c src/fs/proc/proc_sysctl.c
--- src.orig/fs/proc/proc_sysctl.c 2022-04-29 15:52:13.400335767 -0400
+++ src/fs/proc/proc_sysctl.c 2022-04-29 15:52:28.391389115 -0400
@@ -55,6 +55,7 @@ void proc_sys_poll_notify(struct ctl_tab
if (!poll)
return;
+ printk("kpatch-test: testing gcc .isra function name mangling\n");
atomic_inc(&poll->event);
wake_up_interruptible(&poll->wait);
}

View File

@ -1,13 +0,0 @@
diff -Nupr src.orig/mm/slub.c src/mm/slub.c
--- src.orig/mm/slub.c 2022-04-29 15:52:13.612336521 -0400
+++ src/mm/slub.c 2022-04-29 15:52:31.210399147 -0400
@@ -6222,6 +6222,9 @@ void get_slabinfo(struct kmem_cache *s,
int node;
struct kmem_cache_node *n;
+ if (!jiffies)
+ printk("slabinfo\n");
+
for_each_kmem_cache_node(s, node, n) {
nr_slabs += node_nr_slabs(n);
nr_objs += node_nr_objs(n);

View File

@ -1,13 +0,0 @@
diff -Nupr src.orig/mm/mmap.c src/mm/mmap.c
--- src.orig/mm/mmap.c 2022-04-29 15:52:13.610336514 -0400
+++ src/mm/mmap.c 2022-04-29 15:52:34.000409076 -0400
@@ -1723,6 +1723,9 @@ unsigned long mmap_region(struct file *f
struct rb_node **rb_link, *rb_parent;
unsigned long charged = 0;
+ if (!jiffies)
+ printk("kpatch mmap foo\n");
+
/* Check against address space limit. */
if (!may_expand_vm(mm, vm_flags, len >> PAGE_SHIFT)) {
unsigned long nr_pages;

View File

@ -1,19 +0,0 @@
diff -Nupr src.orig/kernel/reboot.c src/kernel/reboot.c
--- src.orig/kernel/reboot.c 2022-04-29 15:52:13.578336400 -0400
+++ src/kernel/reboot.c 2022-04-29 15:52:36.769418930 -0400
@@ -397,8 +397,15 @@ SYSCALL_DEFINE4(reboot, int, magic1, int
return ret;
}
+void kpatch_bar(void)
+{
+ if (!jiffies)
+ printk("kpatch_foo\n");
+}
+
static void deferred_cad(struct work_struct *dummy)
{
+ kpatch_bar();
kernel_restart(NULL);
}

View File

@ -1,22 +0,0 @@
diff -Nupr src.orig/fs/aio.c src/fs/aio.c
--- src.orig/fs/aio.c 2022-04-29 15:52:13.345335571 -0400
+++ src/fs/aio.c 2022-04-29 15:52:39.560428863 -0400
@@ -278,11 +278,18 @@ static int __init aio_setup(void)
}
__initcall(aio_setup);
+void kpatch_aio_foo(void)
+{
+ if (!jiffies)
+ printk("kpatch aio foo\n");
+}
+
static void put_aio_ring_file(struct kioctx *ctx)
{
struct file *aio_ring_file = ctx->aio_ring_file;
struct address_space *i_mapping;
+ kpatch_aio_foo();
if (aio_ring_file) {
truncate_setsize(file_inode(aio_ring_file), 0);

View File

@ -1,8 +0,0 @@
#!/bin/bash
set -o pipefail
if ! $(eu-readelf --wide --symbols test-gcc-static-local-var-4.ko | awk '$NF == "free_ioctx" { exit 1 }'); then
exit 1
else
exit 0
fi

View File

@ -1,69 +0,0 @@
diff -Nupr src.orig/kernel/audit.c src/kernel/audit.c
--- src.orig/kernel/audit.c 2022-04-29 15:52:13.576336393 -0400
+++ src/kernel/audit.c 2022-04-29 15:52:42.384438912 -0400
@@ -314,6 +314,12 @@ void audit_panic(const char *message)
}
}
+void kpatch_audit_foo(void)
+{
+ if (!jiffies)
+ printk("kpatch audit foo\n");
+}
+
static inline int audit_rate_check(void)
{
static unsigned long last_check = 0;
@@ -324,6 +330,7 @@ static inline int audit_rate_check(void)
unsigned long elapsed;
int retval = 0;
+ kpatch_audit_foo();
if (!audit_rate_limit) return 1;
spin_lock_irqsave(&lock, flags);
@@ -343,6 +350,11 @@ static inline int audit_rate_check(void)
return retval;
}
+noinline void kpatch_audit_check(void)
+{
+ audit_rate_check();
+}
+
/**
* audit_log_lost - conditionally log lost audit message event
* @message: the message stating reason for lost audit message
@@ -389,6 +401,8 @@ static int audit_log_config_change(char
struct audit_buffer *ab;
int rc = 0;
+ kpatch_audit_check();
+
ab = audit_log_start(audit_context(), GFP_KERNEL, AUDIT_CONFIG_CHANGE);
if (unlikely(!ab))
return rc;
@@ -1095,6 +1109,7 @@ static int audit_get_feature(struct sk_b
return 0;
}
+__attribute__((optimize("-fno-optimize-sibling-calls")))
static void audit_log_feature_change(int which, u32 old_feature, u32 new_feature,
u32 old_lock, u32 new_lock, int res)
{
@@ -2230,6 +2245,7 @@ EXPORT_SYMBOL(audit_log_task_info);
* @type: audit message type (AUDIT_ANOM_LINK, AUDIT_ANOM_CREAT, etc)
* @operation: specific operation name
*/
+__attribute__((optimize("-fno-optimize-sibling-calls")))
void audit_log_path_denied(int type, const char *operation)
{
struct audit_buffer *ab;
@@ -2368,6 +2384,7 @@ int audit_signal_info(int sig, struct ta
* queue and a kthread is scheduled to remove them from the queue outside the
* irq context. May be called in any context.
*/
+__attribute__((optimize("-fno-optimize-sibling-calls")))
void audit_log_end(struct audit_buffer *ab)
{
struct sk_buff *skb;

View File

@ -1,165 +0,0 @@
diff -Nupr src.orig/net/ipv4/fib_frontend.c src/net/ipv4/fib_frontend.c
--- src.orig/net/ipv4/fib_frontend.c 2022-04-29 15:52:13.635336603 -0400
+++ src/net/ipv4/fib_frontend.c 2022-04-29 15:52:50.873469122 -0400
@@ -865,6 +865,7 @@ errout:
return err;
}
+#include "kpatch-macros.h"
static int inet_rtm_newroute(struct sk_buff *skb, struct nlmsghdr *nlh,
struct netlink_ext_ack *extack)
{
@@ -886,6 +887,7 @@ static int inet_rtm_newroute(struct sk_b
err = fib_table_insert(net, tb, &cfg, extack);
if (!err && cfg.fc_type == RTN_LOCAL)
net->ipv4.fib_has_custom_local_routes = true;
+ KPATCH_PRINTK("[inet_rtm_newroute]: err is %d\n", err);
errout:
return err;
}
diff -Nupr src.orig/net/ipv4/fib_semantics.c src/net/ipv4/fib_semantics.c
--- src.orig/net/ipv4/fib_semantics.c 2022-04-29 15:52:13.635336603 -0400
+++ src/net/ipv4/fib_semantics.c 2022-04-29 15:52:50.873469122 -0400
@@ -1342,6 +1342,7 @@ static bool fib_valid_prefsrc(struct fib
return true;
}
+#include "kpatch-macros.h"
struct fib_info *fib_create_info(struct fib_config *cfg,
struct netlink_ext_ack *extack)
{
@@ -1393,6 +1394,7 @@ struct fib_info *fib_create_info(struct
#endif
err = -ENOBUFS;
+ KPATCH_PRINTK("[fib_create_info]: create error err is %d\n",err);
if (fib_info_cnt >= fib_info_hash_size) {
unsigned int new_size = fib_info_hash_size << 1;
struct hlist_head *new_info_hash;
@@ -1413,6 +1415,7 @@ struct fib_info *fib_create_info(struct
if (!fib_info_hash_size)
goto failure;
}
+ KPATCH_PRINTK("[fib_create_info]: 2 create error err is %d\n",err);
fi = kzalloc(struct_size(fi, fib_nh, nhs), GFP_KERNEL);
if (!fi)
@@ -1426,6 +1429,8 @@ struct fib_info *fib_create_info(struct
}
fib_info_cnt++;
+ KPATCH_PRINTK("[fib_create_info]: 3 create error err is %d\n",err);
+
fi->fib_net = net;
fi->fib_protocol = cfg->fc_protocol;
fi->fib_scope = cfg->fc_scope;
@@ -1452,13 +1457,18 @@ struct fib_info *fib_create_info(struct
if (cfg->fc_mp)
err = fib_get_nhs(fi, cfg->fc_mp, cfg->fc_mp_len, cfg,
extack);
- else
+ else {
+ KPATCH_PRINTK("[fib_create_info]: 4 create error err is %d\n",err);
err = fib_nh_init(net, fi->fib_nh, cfg, 1, extack);
+ KPATCH_PRINTK("[fib_create_info]: 5 create error err is %d\n",err);
+ }
}
if (err != 0)
goto failure;
+ KPATCH_PRINTK("[fib_create_info]: 6 create error err is %d\n",err);
+
if (fib_props[cfg->fc_type].error) {
if (cfg->fc_gw_family || cfg->fc_oif || cfg->fc_mp) {
NL_SET_ERR_MSG(extack,
@@ -1479,6 +1489,7 @@ struct fib_info *fib_create_info(struct
goto err_inval;
}
}
+ KPATCH_PRINTK("[fib_create_info]: 7 create error err is %d\n",err);
if (cfg->fc_scope > RT_SCOPE_HOST) {
NL_SET_ERR_MSG(extack, "Invalid scope");
@@ -1523,6 +1534,7 @@ struct fib_info *fib_create_info(struct
if (linkdown == fi->fib_nhs)
fi->fib_flags |= RTNH_F_LINKDOWN;
}
+ KPATCH_PRINTK("[fib_create_info]: 8 create error err is %d\n",err);
if (fi->fib_prefsrc && !fib_valid_prefsrc(cfg, fi->fib_prefsrc)) {
NL_SET_ERR_MSG(extack, "Invalid prefsrc address");
@@ -1536,6 +1548,7 @@ struct fib_info *fib_create_info(struct
if (nexthop_nh->fib_nh_gw_family == AF_INET6)
fi->fib_nh_is_v6 = true;
} endfor_nexthops(fi)
+ KPATCH_PRINTK("[fib_create_info]: 9 create error err is %d\n",err);
fib_rebalance(fi);
}
@@ -1548,6 +1561,7 @@ link_it:
ofi->fib_treeref++;
return ofi;
}
+ KPATCH_PRINTK("[fib_create_info]: 10 create error err is %d\n",err);
fi->fib_treeref++;
refcount_set(&fi->fib_clntref, 1);
@@ -1575,6 +1589,7 @@ link_it:
} endfor_nexthops(fi)
}
spin_unlock_bh(&fib_info_lock);
+ KPATCH_PRINTK("[fib_create_info]: 11 create error err is %d\n",err);
return fi;
err_inval:
@@ -1585,6 +1600,7 @@ failure:
fi->fib_dead = 1;
free_fib_info(fi);
}
+ KPATCH_PRINTK("[fib_create_info]: 12 create error err is %d\n",err);
return ERR_PTR(err);
}
diff -Nupr src.orig/net/ipv4/fib_trie.c src/net/ipv4/fib_trie.c
--- src.orig/net/ipv4/fib_trie.c 2022-04-29 15:52:13.635336603 -0400
+++ src/net/ipv4/fib_trie.c 2022-04-29 15:52:50.874469126 -0400
@@ -532,6 +532,7 @@ static struct key_vector *replace(struct
return tp;
}
+__attribute__((optimize("-fno-optimize-sibling-calls")))
static struct key_vector *inflate(struct trie *t,
struct key_vector *oldtnode)
{
@@ -628,6 +629,7 @@ notnode:
return NULL;
}
+__attribute__((optimize("-fno-optimize-sibling-calls")))
static struct key_vector *halve(struct trie *t,
struct key_vector *oldtnode)
{
@@ -1200,6 +1202,7 @@ static void fib_remove_alias(struct trie
struct key_vector *l, struct fib_alias *old);
/* Caller must hold RTNL. */
+#include "kpatch-macros.h"
int fib_table_insert(struct net *net, struct fib_table *tb,
struct fib_config *cfg, struct netlink_ext_ack *extack)
{
@@ -1221,11 +1224,14 @@ int fib_table_insert(struct net *net, st
pr_debug("Insert table=%u %08x/%d\n", tb->tb_id, key, plen);
+ KPATCH_PRINTK("[fib_table_insert]: start\n");
fi = fib_create_info(cfg, extack);
if (IS_ERR(fi)) {
err = PTR_ERR(fi);
+ KPATCH_PRINTK("[fib_table_insert]: create error err is %d\n",err);
goto err;
}
+ KPATCH_PRINTK("[fib_table_insert]: cross\n");
l = fib_find_node(t, &tp, key);
fa = l ? fib_find_alias(&l->leaf, slen, tos, fi->fib_priority,

View File

@ -1,11 +0,0 @@
diff -Nupr src.orig/fs/proc/meminfo.c src/fs/proc/meminfo.c
--- src.orig/fs/proc/meminfo.c 2022-04-29 15:52:13.399335763 -0400
+++ src/fs/proc/meminfo.c 2022-04-29 15:52:56.486489097 -0400
@@ -155,6 +155,7 @@ static int meminfo_proc_show(struct seq_
static int __init proc_meminfo_init(void)
{
+ printk("a\n");
proc_create_single("meminfo", 0, NULL, meminfo_proc_show);
return 0;
}

View File

@ -1,19 +0,0 @@
diff -Nupr src.orig/fs/proc/meminfo.c src/fs/proc/meminfo.c
--- src.orig/fs/proc/meminfo.c 2022-04-29 15:52:13.399335763 -0400
+++ src/fs/proc/meminfo.c 2022-04-29 15:52:53.660479040 -0400
@@ -39,6 +39,7 @@ static int meminfo_proc_show(struct seq_
unsigned long sreclaimable, sunreclaim;
int lru;
+ printk("a\n");
si_meminfo(&i);
si_swapinfo(&i);
committed = vm_memory_committed();
@@ -155,6 +156,7 @@ static int meminfo_proc_show(struct seq_
static int __init proc_meminfo_init(void)
{
+ printk("a\n");
proc_create_single("meminfo", 0, NULL, meminfo_proc_show);
return 0;
}

View File

@ -1,3 +0,0 @@
#!/bin/bash
grep VMALLOCCHUNK /proc/meminfo

View File

@ -1,12 +0,0 @@
diff -Nupr src.orig/fs/proc/meminfo.c src/fs/proc/meminfo.c
--- src.orig/fs/proc/meminfo.c 2022-04-29 15:52:13.399335763 -0400
+++ src/fs/proc/meminfo.c 2022-04-29 15:52:59.251498937 -0400
@@ -119,7 +119,7 @@ static int meminfo_proc_show(struct seq_
seq_printf(m, "VmallocTotal: %8lu kB\n",
(unsigned long)VMALLOC_TOTAL >> 10);
show_val_kb(m, "VmallocUsed: ", vmalloc_nr_pages());
- show_val_kb(m, "VmallocChunk: ", 0ul);
+ show_val_kb(m, "VMALLOCCHUNK: ", 0ul);
show_val_kb(m, "Percpu: ", pcpu_nr_pages());
#ifdef CONFIG_MEMORY_FAILURE

View File

@ -1,11 +0,0 @@
diff -Nupr src.orig/fs/proc/generic.c src/fs/proc/generic.c
--- src.orig/fs/proc/generic.c 2022-04-29 15:52:13.399335763 -0400
+++ src/fs/proc/generic.c 2022-04-29 15:53:10.475538880 -0400
@@ -203,6 +203,7 @@ int proc_alloc_inum(unsigned int *inum)
{
int i;
+ printk("kpatch-test: testing change to .parainstructions section\n");
i = ida_simple_get(&proc_inum_ida, 0, UINT_MAX - PROC_DYNAMIC_FIRST + 1,
GFP_KERNEL);
if (i < 0)

View File

@ -1,13 +0,0 @@
diff -Nupr src.orig/drivers/tty/tty_buffer.c src/drivers/tty/tty_buffer.c
--- src.orig/drivers/tty/tty_buffer.c 2022-04-29 15:52:13.275335322 -0400
+++ src/drivers/tty/tty_buffer.c 2022-04-29 15:53:16.055558738 -0400
@@ -263,6 +263,9 @@ static int __tty_buffer_request_room(str
struct tty_buffer *b, *n;
int left, change;
+ if (!size)
+ printk("kpatch-test: testing .smp_locks section changes\n");
+
b = buf->tail;
if (b->flags & TTYB_NORMAL)
left = 2 * b->size - b->used;

View File

@ -1,18 +0,0 @@
diff -Nupr src.orig/kernel/time/timer.c src/kernel/time/timer.c
--- src.orig/kernel/time/timer.c 2022-04-29 15:52:13.591336446 -0400
+++ src/kernel/time/timer.c 2022-04-29 15:53:24.467588674 -0400
@@ -1740,10 +1740,14 @@ static inline void __run_timers(struct t
/*
* This function runs timers and the timer-tq in bottom half context.
*/
+__attribute__((optimize("-fno-optimize-sibling-calls")))
static __latent_entropy void run_timer_softirq(struct softirq_action *h)
{
struct timer_base *base = this_cpu_ptr(&timer_bases[BASE_STD]);
+ if (!base)
+ printk("kpatch-test: testing __tracepoints section changes\n");
+
__run_timers(base);
if (IS_ENABLED(CONFIG_NO_HZ_COMMON))
__run_timers(this_cpu_ptr(&timer_bases[BASE_DEF]));