Update kernel to v5.10.177

This commit updates kernel to 5.10.177 to fix following CVE issue:
CVE-2022-4379: https://nvd.nist.gov/vuln/detail/CVE-2022-4379

One of our source patches requires refresh against the new kernel
source. It was modified to acommodate the context changes in the new
kernel:
	0001-Notification-of-death-of-arbitrary-processes.patch

Verification:
- Build kernel and out of tree modules success for rt and std.
- Build iso success for rt and std.
- Install success onto a All-in-One lab with rt kernel.
- Boot up successfully in the lab.
- The sanity testing was run including kernel and applications
  by our test team.
- The cyclictest benchmark was also run on the starlingx lab, the result
  is "samples: 259199999 avg: 1614 max: 4759 99.9999th percentile: 2572
  overflows: 0", It is not big difference with 5.10.162 for avg and max,
  but percentile seems little lower than 5.10.162.

Closes-Bug: 2015711
Change-Id: I98a92534154989446ba6eda9529cd799498ee800
Signed-off-by: Peng Zhang <Peng.Zhang2@windriver.com>
This commit is contained in:
Peng Zhang 2023-04-28 03:51:42 +08:00
parent 63492b8ddd
commit d5db2760ab
10 changed files with 114 additions and 48 deletions

View File

@ -0,0 +1,30 @@
From bcf3e28debee7cef9e37f4c750025530d99f943c Mon Sep 17 00:00:00 2001
From: Peng Zhang <Peng.Zhang2@windriver.com>
Date: Thu, 27 Apr 2023 19:34:33 +0000
Subject: [PATCH] Upgrade 5.10 kernel to 5.10.177
Update debian/changelog.
Signed-off-by: Peng Zhang <Peng.Zhang2@windriver.com>
---
debian/changelog | 7 +++++++
1 file changed, 7 insertions(+)
diff --git a/debian/changelog b/debian/changelog
index 98186df..f454f64 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,3 +1,10 @@
+linux-rt (5.10.177-1) unstable; urgency=medium
+
+ * New upstream update:
+ https://git.yoctoproject.org/linux-yocto/log/?h=v5.10%2Fstandard%2Fpreempt-rt%2Fbase&qt=range&q=f6146935c0b2cb2d342d8d188e7779c8244883a3
+
+ -- Peng Zhang <Peng.Zhang2@windriver.com> Wed, 26 Apr 2023 19:13:42 +0000
+
linux-rt (5.10.162-1) unstable; urgency=medium
* New upstream update:
--
2.30.2

View File

@ -22,3 +22,4 @@
0022-config-don-t-unset-CONFIG_EFIVAR_FS.patch
0023-Upgrade-5.10-kernel-to-5.10.162.patch
0024-Fix-badly-formatted-trailer-line.patch
0025-Upgrade-5.10-kernel-to-5.10.177.patch

View File

@ -24,7 +24,7 @@
# building.
# Tools needed: tar/sed
KERNEL_HEAD_COMMIT=58d7abb88dadc31a3bdcaabc324ae015d77642b7
KERNEL_HEAD_COMMIT=f6146935c0b2cb2d342d8d188e7779c8244883a3
DEBIAN_FILE=linux_5.10.28-1.debian.tar.xz
tar xvf linux-yocto-${KERNEL_HEAD_COMMIT}.tar.gz

View File

@ -1,14 +1,14 @@
---
debver: 5.10.162
debver: 5.10.177
debname: linux-rt
dl_hook: dl_hook
dl_files:
linux-yocto-58d7abb88dadc31a3bdcaabc324ae015d77642b7.tar.gz:
linux-yocto-f6146935c0b2cb2d342d8d188e7779c8244883a3.tar.gz:
topdir: null
url:
"https://git.yoctoproject.org/linux-yocto/snapshot/\
linux-yocto-58d7abb88dadc31a3bdcaabc324ae015d77642b7.tar.gz"
sha256sum: 490eb16d9482f08a535cf520e956c972c320863af57b9beb28e3acbc078ef370
linux-yocto-f6146935c0b2cb2d342d8d188e7779c8244883a3.tar.gz"
sha256sum: 42b4ea8c50c83468e1b9370037e2e41247a298e1836a8483255edfe10f7b6194
linux_5.10.28-1.debian.tar.xz:
topdir: null
url:

View File

@ -22,6 +22,8 @@ Signed-off-by: Zhang Zhiguo <zhangzhg@neusoft.com>
Signed-off-by: Shuicheng Lin <shuicheng.lin@intel.com>
[jm: Adapted the patch for context changes.]
Signed-off-by: Jiping Ma <jiping.ma2@windriver.com>
[zp: Adapted the patch for context changes.]
Signed-off-by: Peng Zhang <Peng.Zhang2@windriver.com>
---
include/linux/init_task.h | 9 ++
include/linux/sched.h | 6 +
@ -60,10 +62,10 @@ index b2412b4d4..7a0828daf 100644
extern struct cred init_cred;
diff --git a/include/linux/sched.h b/include/linux/sched.h
index 409a24036..3a290cee7 100644
index 34c86a285..81bba855f 100644
--- a/include/linux/sched.h
+++ b/include/linux/sched.h
@@ -1153,6 +1153,12 @@ struct task_struct {
@@ -1156,6 +1156,12 @@ struct task_struct {
short il_prev;
short pref_node_fork;
#endif
@ -104,10 +106,10 @@ index 7f0827705..dbd5a8b6e 100644
#define PR_GET_SECCOMP 21
#define PR_SET_SECCOMP 22
diff --git a/init/Kconfig b/init/Kconfig
index 7ba2b602b..5a5f38706 100644
index ccec53dd4..200efd9db 100644
--- a/init/Kconfig
+++ b/init/Kconfig
@@ -1852,6 +1852,21 @@ config VM_EVENT_COUNTERS
@@ -1867,6 +1867,21 @@ config VM_EVENT_COUNTERS
on EXPERT systems. /proc/vmstat will only show page counts
if VM event counters are disabled.
@ -142,7 +144,7 @@ index 5fa18ed59..e1a245782 100644
.timer_slack_ns = 50000, /* 50 usec default slack */
.thread_pid = &init_struct_pid,
diff --git a/kernel/Makefile b/kernel/Makefile
index e7905bdf6..ba9997c7a 100644
index 82e9c8436..4ad61d5c9 100644
--- a/kernel/Makefile
+++ b/kernel/Makefile
@@ -108,6 +108,7 @@ obj-$(CONFIG_BPF) += bpf/
@ -440,10 +442,10 @@ index 000000000..14a0995b7
+#endif
+
diff --git a/kernel/exit.c b/kernel/exit.c
index f5933bd07..3c328a630 100644
index b86f388d3..82d019293 100644
--- a/kernel/exit.c
+++ b/kernel/exit.c
@@ -68,6 +68,9 @@
@@ -69,6 +69,9 @@
#include <linux/uaccess.h>
#include <asm/unistd.h>
#include <asm/mmu_context.h>
@ -451,9 +453,9 @@ index f5933bd07..3c328a630 100644
+#include "death_notify.h"
+#endif
static void __unhash_process(struct task_struct *p, bool group_dead)
{
@@ -194,6 +197,9 @@ void release_task(struct task_struct *p)
/*
* The default value should be high enough to not crash a system that randomly
@@ -241,6 +244,9 @@ void release_task(struct task_struct *p)
cgroup_release(p);
write_lock_irq(&tasklist_lock);
@ -464,10 +466,10 @@ index f5933bd07..3c328a630 100644
thread_pid = get_pid(p->thread_pid);
__exit_signal(p);
diff --git a/kernel/fork.c b/kernel/fork.c
index 77cb97dc1..316d831cc 100644
index 214697bc3..5d3b9a9d9 100644
--- a/kernel/fork.c
+++ b/kernel/fork.c
@@ -2096,6 +2096,10 @@ static __latent_entropy struct task_struct *copy_process(
@@ -2106,6 +2106,10 @@ static __latent_entropy struct task_struct *copy_process(
p->sequential_io = 0;
p->sequential_io_avg = 0;
#endif
@ -479,7 +481,7 @@ index 77cb97dc1..316d831cc 100644
/* Perform scheduler related setup. Assign this task to a CPU. */
retval = sched_fork(clone_flags, p);
diff --git a/kernel/signal.c b/kernel/signal.c
index 0be3c40c5..1581b2a76 100644
index a1eeecb49..5059e0482 100644
--- a/kernel/signal.c
+++ b/kernel/signal.c
@@ -56,6 +56,9 @@
@ -515,7 +517,7 @@ index 0be3c40c5..1581b2a76 100644
static inline bool may_ptrace_stop(void)
diff --git a/kernel/sys.c b/kernel/sys.c
index 24a3a28ae..72fc9ff5a 100644
index 9f59cc8ab..c41abaaf4 100644
--- a/kernel/sys.c
+++ b/kernel/sys.c
@@ -73,6 +73,9 @@
@ -528,7 +530,7 @@ index 24a3a28ae..72fc9ff5a 100644
#ifndef SET_UNALIGN_CTL
# define SET_UNALIGN_CTL(a, b) (-EINVAL)
@@ -2416,6 +2419,11 @@ SYSCALL_DEFINE5(prctl, int, option, unsigned long, arg2, unsigned long, arg3,
@@ -2418,6 +2421,11 @@ SYSCALL_DEFINE5(prctl, int, option, unsigned long, arg2, unsigned long, arg3,
else
error = PR_MCE_KILL_DEFAULT;
break;
@ -541,5 +543,5 @@ index 24a3a28ae..72fc9ff5a 100644
error = prctl_set_mm(arg2, arg3, arg4, arg5);
break;
--
2.17.1
2.30.2

View File

@ -0,0 +1,30 @@
From 156dc2e2691fef27a611d317ebc703b0a83b964b Mon Sep 17 00:00:00 2001
From: Peng Zhang <Peng.Zhang2@windriver.com>
Date: Thu, 27 Apr 2023 19:28:18 +0000
Subject: [PATCH] Upgrade 5.10 kernel to 5.10.177
Update debian/changelog.
Signed-off-by: Peng Zhang <Peng.Zhang2@windriver.com>
---
debian/changelog | 7 +++++++
1 file changed, 7 insertions(+)
diff --git a/debian/changelog b/debian/changelog
index 3d6de0b..a3fe77e 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,3 +1,10 @@
+linux (5.10.177-1) unstable; urgency=medium
+
+ * New upstream update:
+ https://git.yoctoproject.org/linux-yocto/log/?h=v5.10%2Fstandard%2Fbase&qt=range&q=cf160f367e3ceb54cde11392a80413b152ca4e15
+
+ -- Peng Zhang <Peng.Zhang2@windriver.com> Wed, 26 Apr 2023 19:22:54 +0000
+
linux (5.10.162-1) unstable; urgency=medium
* New upstream update:
--
2.30.2

View File

@ -21,3 +21,4 @@
0021-config-don-t-unset-CONFIG_EFIVAR_FS.patch
0022-Upgrade-5.10-kernel-to-5.10.162.patch
0023-Fix-badly-formatted-trailer-line.patch
0024-Upgrade-5.10-kernel-to-5.10.177.patch

View File

@ -5,7 +5,7 @@
# be put at the same path where this script is located.
# Tools needed: tar
KERNEL_HEAD_COMMIT=353f388471e281c0f387436b035bfdcd2f468505
KERNEL_HEAD_COMMIT=cf160f367e3ceb54cde11392a80413b152ca4e15
DEBIAN_FILE=linux_5.10.28-1.debian.tar.xz
tar xvf linux-yocto-${KERNEL_HEAD_COMMIT}.tar.gz

View File

@ -1,14 +1,14 @@
---
debver: 5.10.162
debver: 5.10.177
debname: linux
dl_hook: dl_hook
dl_files:
linux-yocto-353f388471e281c0f387436b035bfdcd2f468505.tar.gz:
linux-yocto-cf160f367e3ceb54cde11392a80413b152ca4e15.tar.gz:
topdir: null
url:
"https://git.yoctoproject.org/linux-yocto/snapshot/\
linux-yocto-353f388471e281c0f387436b035bfdcd2f468505.tar.gz"
sha256sum: b7e3cd44c7dae21f3c718fbe8b25f93a5a360dbda34d8f66b15c9612e8743bd0
linux-yocto-cf160f367e3ceb54cde11392a80413b152ca4e15.tar.gz"
sha256sum: 0529974cb05301f5b330289d47b2896ddb6ecb7dd454b13a45275290c0d8e608
linux_5.10.28-1.debian.tar.xz:
topdir: null
url:

View File

@ -1,4 +1,4 @@
From a6d19757680f81e529c789e77bcac01f9b9e2fbd Mon Sep 17 00:00:00 2001
From 13872c403cc86c8032c937b166fa5867b98d730b Mon Sep 17 00:00:00 2001
From: Chris Friesen <chris.friesen@windriver.com>
Date: Thu, 17 Jun 2021 07:44:04 +0000
Subject: [PATCH] Notification of death of arbitrary processes
@ -22,6 +22,8 @@ Signed-off-by: Zhang Zhiguo <zhangzhg@neusoft.com>
Signed-off-by: Shuicheng Lin <shuicheng.lin@intel.com>
[jm: Adapted the patch for context changes.]
Signed-off-by: Jiping Ma <jiping.ma2@windriver.com>
[zp: Adapted the patch for context changes.]
Signed-off-by: Peng Zhang <Peng.Zhang2@windriver.com>
---
include/linux/init_task.h | 9 ++
include/linux/sched.h | 6 +
@ -40,7 +42,7 @@ Signed-off-by: Jiping Ma <jiping.ma2@windriver.com>
create mode 100644 kernel/death_notify.h
diff --git a/include/linux/init_task.h b/include/linux/init_task.h
index b2412b4d4c20..7a0828daf59c 100644
index b2412b4d4..7a0828daf 100644
--- a/include/linux/init_task.h
+++ b/include/linux/init_task.h
@@ -25,6 +25,15 @@
@ -60,10 +62,10 @@ index b2412b4d4c20..7a0828daf59c 100644
extern struct cred init_cred;
diff --git a/include/linux/sched.h b/include/linux/sched.h
index 76cd21fa5501..614cd20935a7 100644
index 5da4b3c89..51bbe9252 100644
--- a/include/linux/sched.h
+++ b/include/linux/sched.h
@@ -1119,6 +1119,12 @@ struct task_struct {
@@ -1126,6 +1126,12 @@ struct task_struct {
short il_prev;
short pref_node_fork;
#endif
@ -77,7 +79,7 @@ index 76cd21fa5501..614cd20935a7 100644
int numa_scan_seq;
unsigned int numa_scan_period;
diff --git a/include/uapi/linux/prctl.h b/include/uapi/linux/prctl.h
index 7f0827705c9a..dbd5a8b6e002 100644
index 7f0827705..dbd5a8b6e 100644
--- a/include/uapi/linux/prctl.h
+++ b/include/uapi/linux/prctl.h
@@ -63,6 +63,22 @@
@ -104,10 +106,10 @@ index 7f0827705c9a..dbd5a8b6e002 100644
#define PR_GET_SECCOMP 21
#define PR_SET_SECCOMP 22
diff --git a/init/Kconfig b/init/Kconfig
index fc4c9f416fad..df9d5284f8d6 100644
index eba883d6d..e307211e0 100644
--- a/init/Kconfig
+++ b/init/Kconfig
@@ -1851,6 +1851,21 @@ config VM_EVENT_COUNTERS
@@ -1866,6 +1866,21 @@ config VM_EVENT_COUNTERS
on EXPERT systems. /proc/vmstat will only show page counts
if VM event counters are disabled.
@ -130,7 +132,7 @@ index fc4c9f416fad..df9d5284f8d6 100644
default y
bool "Enable SLUB debugging support" if EXPERT
diff --git a/init/init_task.c b/init/init_task.c
index 16d14c2ebb55..eaee56e60985 100644
index 5fa18ed59..e1a245782 100644
--- a/init/init_task.c
+++ b/init/init_task.c
@@ -128,6 +128,7 @@ struct task_struct init_task
@ -142,7 +144,7 @@ index 16d14c2ebb55..eaee56e60985 100644
.timer_slack_ns = 50000, /* 50 usec default slack */
.thread_pid = &init_struct_pid,
diff --git a/kernel/Makefile b/kernel/Makefile
index 88b60a6e5dd0..36377f54555a 100644
index 82e9c8436..4ad61d5c9 100644
--- a/kernel/Makefile
+++ b/kernel/Makefile
@@ -108,6 +108,7 @@ obj-$(CONFIG_BPF) += bpf/
@ -155,7 +157,7 @@ index 88b60a6e5dd0..36377f54555a 100644
diff --git a/kernel/death_notify.c b/kernel/death_notify.c
new file mode 100644
index 000000000000..5819d35a2564
index 000000000..5819d35a2
--- /dev/null
+++ b/kernel/death_notify.c
@@ -0,0 +1,228 @@
@ -389,7 +391,7 @@ index 000000000000..5819d35a2564
+
diff --git a/kernel/death_notify.h b/kernel/death_notify.h
new file mode 100644
index 000000000000..14a0995b79af
index 000000000..14a0995b7
--- /dev/null
+++ b/kernel/death_notify.h
@@ -0,0 +1,46 @@
@ -440,10 +442,10 @@ index 000000000000..14a0995b79af
+#endif
+
diff --git a/kernel/exit.c b/kernel/exit.c
index d13d67fc5f4e..0e7adf824a52 100644
index bacdaf980..5f5420111 100644
--- a/kernel/exit.c
+++ b/kernel/exit.c
@@ -68,6 +68,9 @@
@@ -69,6 +69,9 @@
#include <linux/uaccess.h>
#include <asm/unistd.h>
#include <asm/mmu_context.h>
@ -451,9 +453,9 @@ index d13d67fc5f4e..0e7adf824a52 100644
+#include "death_notify.h"
+#endif
static void __unhash_process(struct task_struct *p, bool group_dead)
{
@@ -194,6 +197,9 @@ void release_task(struct task_struct *p)
/*
* The default value should be high enough to not crash a system that randomly
@@ -241,6 +244,9 @@ void release_task(struct task_struct *p)
cgroup_release(p);
write_lock_irq(&tasklist_lock);
@ -464,10 +466,10 @@ index d13d67fc5f4e..0e7adf824a52 100644
thread_pid = get_pid(p->thread_pid);
__exit_signal(p);
diff --git a/kernel/fork.c b/kernel/fork.c
index 7c044d377926..5333090a7cc5 100644
index 82aeb023d..1f3bf058c 100644
--- a/kernel/fork.c
+++ b/kernel/fork.c
@@ -2069,6 +2069,10 @@ static __latent_entropy struct task_struct *copy_process(
@@ -2080,6 +2080,10 @@ static __latent_entropy struct task_struct *copy_process(
p->sequential_io = 0;
p->sequential_io_avg = 0;
#endif
@ -479,7 +481,7 @@ index 7c044d377926..5333090a7cc5 100644
/* Perform scheduler related setup. Assign this task to a CPU. */
retval = sched_fork(clone_flags, p);
diff --git a/kernel/signal.c b/kernel/signal.c
index ef8f2a28d37c..5c41ee2ccf7e 100644
index e487c4660..7e9e72ba6 100644
--- a/kernel/signal.c
+++ b/kernel/signal.c
@@ -55,6 +55,9 @@
@ -515,7 +517,7 @@ index ef8f2a28d37c..5c41ee2ccf7e 100644
static inline bool may_ptrace_stop(void)
diff --git a/kernel/sys.c b/kernel/sys.c
index a730c03ee607..0f8decf763f1 100644
index 9f59cc8ab..c41abaaf4 100644
--- a/kernel/sys.c
+++ b/kernel/sys.c
@@ -73,6 +73,9 @@
@ -528,7 +530,7 @@ index a730c03ee607..0f8decf763f1 100644
#ifndef SET_UNALIGN_CTL
# define SET_UNALIGN_CTL(a, b) (-EINVAL)
@@ -2423,6 +2426,11 @@ SYSCALL_DEFINE5(prctl, int, option, unsigned long, arg2, unsigned long, arg3,
@@ -2418,6 +2421,11 @@ SYSCALL_DEFINE5(prctl, int, option, unsigned long, arg2, unsigned long, arg3,
else
error = PR_MCE_KILL_DEFAULT;
break;
@ -541,5 +543,5 @@ index a730c03ee607..0f8decf763f1 100644
error = prctl_set_mm(arg2, arg3, arg4, arg5);
break;
--
2.29.2
2.30.2