Skip to content

Commit c819391

Browse files
authored
Merge pull request #1174 from joe-lawrence/rhel-8.4-support
Additional rhel 8.4 support
2 parents 453fb1b + fed5786 commit c819391

36 files changed

+960
-0
lines changed

kpatch-build/kpatch-build

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -203,6 +203,21 @@ use_klp_arch()
203203
fi
204204
}
205205

206+
rhel_kernel_version_gte() {
207+
[ "${ARCHVERSION}" = "$(echo -e "${ARCHVERSION}\\n$1" | sort -rV | head -n1)" ]
208+
}
209+
210+
# klp.arch relocations were supported prior to v5.8
211+
# and prior to 4.18.0-284.el8
212+
use_klp_arch()
213+
{
214+
if kernel_is_rhel; then
215+
! rhel_kernel_version_gte 4.18.0-284.el8
216+
else
217+
! kernel_version_gte 5.8.0
218+
fi
219+
}
220+
206221
find_dirs() {
207222
if [[ -e "$SCRIPTDIR/create-diff-object" ]]; then
208223
# git repo
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
diff -Nupr src.orig/fs/proc/proc_sysctl.c src/fs/proc/proc_sysctl.c
2+
--- src.orig/fs/proc/proc_sysctl.c 2021-04-20 11:04:26.717100594 -0400
3+
+++ src/fs/proc/proc_sysctl.c 2021-04-20 11:04:27.636102900 -0400
4+
@@ -338,6 +338,8 @@ static void start_unregistering(struct c
5+
6+
static struct ctl_table_header *sysctl_head_grab(struct ctl_table_header *head)
7+
{
8+
+ if (jiffies == 0)
9+
+ printk("kpatch-test: testing __bug_table section changes\n");
10+
BUG_ON(!head);
11+
spin_lock(&sysctl_lock);
12+
if (!use_table(head))
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
#!/bin/bash
2+
3+
grep kpatch=1 /proc/cmdline
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
diff -Nupr src.orig/fs/proc/cmdline.c src/fs/proc/cmdline.c
2+
--- src.orig/fs/proc/cmdline.c 2021-04-20 11:04:26.717100594 -0400
3+
+++ src/fs/proc/cmdline.c 2021-04-20 11:04:30.118109128 -0400
4+
@@ -6,8 +6,7 @@
5+
6+
static int cmdline_proc_show(struct seq_file *m, void *v)
7+
{
8+
- seq_puts(m, saved_command_line);
9+
- seq_putc(m, '\n');
10+
+ seq_printf(m, "%s kpatch=1\n", saved_command_line);
11+
return 0;
12+
}
13+
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
#!/bin/bash
2+
3+
grep "kpatch: 5" /proc/meminfo
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
diff -Nupr src.orig/fs/proc/meminfo.c src/fs/proc/meminfo.c
2+
--- src.orig/fs/proc/meminfo.c 2021-04-20 11:04:26.717100594 -0400
3+
+++ src/fs/proc/meminfo.c 2021-04-20 11:04:32.584115315 -0400
4+
@@ -31,6 +31,8 @@ static void show_val_kb(struct seq_file
5+
seq_write(m, " kB\n", 4);
6+
}
7+
8+
+static int foo = 5;
9+
+
10+
static int meminfo_proc_show(struct seq_file *m, void *v)
11+
{
12+
struct sysinfo i;
13+
@@ -146,6 +148,7 @@ static int meminfo_proc_show(struct seq_
14+
show_val_kb(m, "CmaFree: ",
15+
global_zone_page_state(NR_FREE_CMA_PAGES));
16+
#endif
17+
+ seq_printf(m, "kpatch: %d\n", foo);
18+
19+
hugetlb_report_meminfo(m);
20+
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
diff -Nupr src.orig/net/core/dev.c src/net/core/dev.c
2+
--- src.orig/net/core/dev.c 2021-04-20 11:04:27.355102195 -0400
3+
+++ src/net/core/dev.c 2021-04-20 11:04:34.800120875 -0400
4+
@@ -5058,6 +5058,7 @@ skip_classify:
5+
case RX_HANDLER_PASS:
6+
break;
7+
default:
8+
+ printk("BUG!\n");
9+
BUG();
10+
}
11+
}
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
diff -Nupr src.orig/fs/readdir.c src/fs/readdir.c
2+
--- src.orig/fs/readdir.c 2021-04-20 11:04:26.675100489 -0400
3+
+++ src/fs/readdir.c 2021-04-20 11:04:36.984126354 -0400
4+
@@ -189,6 +189,7 @@ static int filldir(struct dir_context *c
5+
goto efault;
6+
}
7+
dirent = buf->current_dir;
8+
+ asm("nop");
9+
if (__put_user(d_ino, &dirent->d_ino))
10+
goto efault;
11+
if (__put_user(reclen, &dirent->d_reclen))
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
diff -Nupr src.orig/kernel/time/timekeeping.c src/kernel/time/timekeeping.c
2+
--- src.orig/kernel/time/timekeeping.c 2021-04-20 11:04:27.325102120 -0400
3+
+++ src/kernel/time/timekeeping.c 2021-04-20 11:04:39.253132047 -0400
4+
@@ -1231,6 +1231,9 @@ void do_gettimeofday(struct timeval *tv)
5+
{
6+
struct timespec64 now;
7+
8+
+ if (!tv)
9+
+ return;
10+
+
11+
getnstimeofday64(&now);
12+
tv->tv_sec = now.tv_sec;
13+
tv->tv_usec = now.tv_nsec/1000;
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
diff -Nupr src.orig/fs/proc/proc_sysctl.c src/fs/proc/proc_sysctl.c
2+
--- src.orig/fs/proc/proc_sysctl.c 2021-04-20 11:04:26.717100594 -0400
3+
+++ src/fs/proc/proc_sysctl.c 2021-04-20 11:04:41.824138498 -0400
4+
@@ -53,6 +53,7 @@ void proc_sys_poll_notify(struct ctl_tab
5+
if (!poll)
6+
return;
7+
8+
+ printk("kpatch-test: testing gcc .isra function name mangling\n");
9+
atomic_inc(&poll->event);
10+
wake_up_interruptible(&poll->wait);
11+
}

0 commit comments

Comments
 (0)