From a0cfbf7002cfbfada6ad66d355fd008a72e00c89 Mon Sep 17 00:00:00 2001 From: Markus Boehme Date: Wed, 10 Jan 2024 11:01:18 +0000 Subject: [PATCH 1/5] kernel-5.10: update to 5.10.205 Rebase to Amazon Linux upstream version 5.10.205-195.804.amzn2. Signed-off-by: Markus Boehme --- packages/kernel-5.10/Cargo.toml | 4 ++-- packages/kernel-5.10/kernel-5.10.spec | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/packages/kernel-5.10/Cargo.toml b/packages/kernel-5.10/Cargo.toml index 2a37fa30a00..e86801b2a29 100644 --- a/packages/kernel-5.10/Cargo.toml +++ b/packages/kernel-5.10/Cargo.toml @@ -14,8 +14,8 @@ path = "../packages.rs" [[package.metadata.build-package.external-files]] # Use latest-srpm-url.sh to get this. -url = "https://cdn.amazonlinux.com/blobstore/d56d799376346afd56ebe3eec4b500b23c6fd3954f66b65aa7c867848d17a950/kernel-5.10.201-191.748.amzn2.src.rpm" -sha512 = "8d8715a1e06dbf7adbc1b5f80e99ec6b5d448c9aefd69f48f77fe6c80bd0e2668a963f85360fefd93ea979e2d2a5323d916301f2f59961e125a5fe6c8b38065f" +url = "https://cdn.amazonlinux.com/blobstore/9feb6cecf780648ffd492525552ba31ce039667031f7ff32ff8a8802145f4827/kernel-5.10.205-195.804.amzn2.src.rpm" +sha512 = "409ddcfcd2f29ab7e7cff8d38ea00fbbd2f2960e4eeffbb4031997921becc797b7e29a66c3869b70e362530d2ed30b747472dbee229f21f9499e3d90f40a880e" [build-dependencies] microcode = { path = "../microcode" } diff --git a/packages/kernel-5.10/kernel-5.10.spec b/packages/kernel-5.10/kernel-5.10.spec index 20a3d994e4b..7210a0eaffd 100644 --- a/packages/kernel-5.10/kernel-5.10.spec +++ b/packages/kernel-5.10/kernel-5.10.spec @@ -1,13 +1,13 @@ %global debug_package %{nil} Name: %{_cross_os}kernel-5.10 -Version: 5.10.201 +Version: 5.10.205 Release: 1%{?dist} Summary: The Linux kernel License: GPL-2.0 WITH Linux-syscall-note URL: https://www.kernel.org/ # Use latest-srpm-url.sh to get this. -Source0: https://cdn.amazonlinux.com/blobstore/d56d799376346afd56ebe3eec4b500b23c6fd3954f66b65aa7c867848d17a950/kernel-5.10.201-191.748.amzn2.src.rpm +Source0: https://cdn.amazonlinux.com/blobstore/9feb6cecf780648ffd492525552ba31ce039667031f7ff32ff8a8802145f4827/kernel-5.10.205-195.804.amzn2.src.rpm Source100: config-bottlerocket Source101: config-bottlerocket-aws Source102: config-bottlerocket-metal From c8d6cfcc685426e15eb6c62d8d4aeb6f503157f9 Mon Sep 17 00:00:00 2001 From: Markus Boehme Date: Wed, 10 Jan 2024 11:02:27 +0000 Subject: [PATCH 2/5] kernel-5.15: update to 5.15.145 Rebase to Amazon Linux upstream version 5.15.145-95.156.amzn2. Signed-off-by: Markus Boehme --- packages/kernel-5.15/Cargo.toml | 4 ++-- packages/kernel-5.15/kernel-5.15.spec | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/packages/kernel-5.15/Cargo.toml b/packages/kernel-5.15/Cargo.toml index bca97934fd2..3bc83fdc52a 100644 --- a/packages/kernel-5.15/Cargo.toml +++ b/packages/kernel-5.15/Cargo.toml @@ -14,8 +14,8 @@ path = "../packages.rs" [[package.metadata.build-package.external-files]] # Use latest-srpm-url.sh to get this. -url = "https://cdn.amazonlinux.com/blobstore/76d66a34d25e5ebc08dc424d9b03b0ecb44046eb05d95e47459447a5ab582cd2/kernel-5.15.139-93.147.amzn2.src.rpm" -sha512 = "f63269b6466df01b5a6a3387091665cb8931090fa73d848f0d77a6729aa7241d04be77383e34a41bed575cd295bf722bd6668965d1f1147d9ca975ae04b53219" +url = "https://cdn.amazonlinux.com/blobstore/ee035f7e9f6cfe0e00a4c32b3f7d9170e85ca9e9f5cc5026b601b532343b260d/kernel-5.15.145-95.156.amzn2.src.rpm" +sha512 = "372738cd8139c6904a047e9298373ee60dc64a5776a624399615ad13736fc21cd9ab70bccee4a0aa12fcdbbf3fd2b1d01a9d8bf4ad6c4b9063f0404c904db250" [build-dependencies] microcode = { path = "../microcode" } diff --git a/packages/kernel-5.15/kernel-5.15.spec b/packages/kernel-5.15/kernel-5.15.spec index 061d3e20266..c3f1dce9d09 100644 --- a/packages/kernel-5.15/kernel-5.15.spec +++ b/packages/kernel-5.15/kernel-5.15.spec @@ -1,13 +1,13 @@ %global debug_package %{nil} Name: %{_cross_os}kernel-5.15 -Version: 5.15.139 +Version: 5.15.145 Release: 1%{?dist} Summary: The Linux kernel License: GPL-2.0 WITH Linux-syscall-note URL: https://www.kernel.org/ # Use latest-srpm-url.sh to get this. -Source0: https://cdn.amazonlinux.com/blobstore/76d66a34d25e5ebc08dc424d9b03b0ecb44046eb05d95e47459447a5ab582cd2/kernel-5.15.139-93.147.amzn2.src.rpm +Source0: https://cdn.amazonlinux.com/blobstore/ee035f7e9f6cfe0e00a4c32b3f7d9170e85ca9e9f5cc5026b601b532343b260d/kernel-5.15.145-95.156.amzn2.src.rpm Source100: config-bottlerocket Source101: config-bottlerocket-aws Source102: config-bottlerocket-metal From ea638f04defa64b19b34bc21281b80eae7df97dd Mon Sep 17 00:00:00 2001 From: Markus Boehme Date: Wed, 10 Jan 2024 11:03:13 +0000 Subject: [PATCH 3/5] kernel-6.1: update to 6.1.66 Rebase to Amazon Linux upstream version 6.1.66-93.164.amzn2023. Signed-off-by: Markus Boehme --- packages/kernel-6.1/Cargo.toml | 4 ++-- packages/kernel-6.1/kernel-6.1.spec | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/packages/kernel-6.1/Cargo.toml b/packages/kernel-6.1/Cargo.toml index 7ea34ed2a24..55e36acd0d6 100644 --- a/packages/kernel-6.1/Cargo.toml +++ b/packages/kernel-6.1/Cargo.toml @@ -14,8 +14,8 @@ path = "../packages.rs" [[package.metadata.build-package.external-files]] # Use latest-srpm-url.sh to get this. -url = "https://cdn.amazonlinux.com/al2023/blobstore/5880ce1298c2bb541461845a29b2787036b8d18aff0f0bc308117a5f9990057e/kernel-6.1.66-91.160.amzn2023.src.rpm" -sha512 = "4a2b52e6fc8045a5bdf3f7a4a8080623206352e2921d9cf899e367c9102a806dc1135985863cb5efc43c4a757971404e88abdea9c78dcb55cb64e204f97dc232" +url = "https://cdn.amazonlinux.com/al2023/blobstore/f0517376e35e75defefac98e867091249abdcbad3d0958d58d19c0db26a8d0c7/kernel-6.1.66-93.164.amzn2023.src.rpm" +sha512 = "215330abf659fd459d79bee3cd1c7beb6075a08f3eacd484ce1836169e436ea6b98462e9e5bd6d1ccb79474b1b5c54f21f3e5643fc47fac954ae84701c32a00c" [build-dependencies] microcode = { path = "../microcode" } diff --git a/packages/kernel-6.1/kernel-6.1.spec b/packages/kernel-6.1/kernel-6.1.spec index bfb192a27a2..140122898b3 100644 --- a/packages/kernel-6.1/kernel-6.1.spec +++ b/packages/kernel-6.1/kernel-6.1.spec @@ -7,7 +7,7 @@ Summary: The Linux kernel License: GPL-2.0 WITH Linux-syscall-note URL: https://www.kernel.org/ # Use latest-srpm-url.sh to get this. -Source0: https://cdn.amazonlinux.com/al2023/blobstore/5880ce1298c2bb541461845a29b2787036b8d18aff0f0bc308117a5f9990057e/kernel-6.1.66-91.160.amzn2023.src.rpm +Source0: https://cdn.amazonlinux.com/al2023/blobstore/f0517376e35e75defefac98e867091249abdcbad3d0958d58d19c0db26a8d0c7/kernel-6.1.66-93.164.amzn2023.src.rpm Source100: config-bottlerocket Source101: config-bottlerocket-aws Source102: config-bottlerocket-metal From 6fd5e22411b67f638abe97361878a0ac38fcd336 Mon Sep 17 00:00:00 2001 From: Markus Boehme Date: Wed, 10 Jan 2024 19:22:14 +0000 Subject: [PATCH 4/5] kernel-5.10: disable unused Mellanox network drivers The recent update to the 5.10 kernel picked up a bunch of Mellanox network drivers from the Amazon Linux kernel. We don't need those, so deactivate them again. Signed-off-by: Markus Boehme --- packages/kernel-5.10/config-bottlerocket | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/packages/kernel-5.10/config-bottlerocket b/packages/kernel-5.10/config-bottlerocket index 7a1b1ef0ef5..264e12b633c 100644 --- a/packages/kernel-5.10/config-bottlerocket +++ b/packages/kernel-5.10/config-bottlerocket @@ -154,6 +154,11 @@ CONFIG_EXT4_USE_FOR_EXT2=y # Disable obsolete NIC drivers # CONFIG_QLGE is not set +# CONFIG_MLX4_CORE is not set +# CONFIG_MLX4_EN is not set +# CONFIG_MLX4_INFINIBAND is not set +# CONFIG_MLXSW_CORE is not set +# CONFIG_MLXFW is not set # Disable unused qdiscs # - sch_cake targets home routers and residential links @@ -171,3 +176,4 @@ CONFIG_SCSI_SMARTPQI=m # Disable AL port of BBR2 congestion algorithm # CONFIG_TCP_CONG_BBR2 is not set + From e97ca0c7d17c4e7983bc7907765d7a61c7779f72 Mon Sep 17 00:00:00 2001 From: Markus Boehme Date: Wed, 10 Jan 2024 20:46:42 +0000 Subject: [PATCH 5/5] kernel-5.15: backport fix for creating kprobes using unqualified names Commit b022f0c7e404 ("tracing/kprobes: Return EADDRNOTAVAIL when func matches several symbols") in the upstream kernel introduced a regression where kprobes cannot be created on functions residing in loadable modules if the probe location is identified by an unqualified function name. The faulty commit was backported to the 5.15, but a backport of the fix is not yet available. Carry the fix here for release preparation and seek resolution upstream as soon as possible. This may mean upstreaming, or reverting the faulty commit entirely (sentiment for the faulty commit has soured, and it has been yanked already from patch queues for older stable series). Signed-off-by: Markus Boehme --- ...dule_kallsyms_on_each_symbol-general.patch | 73 +++++++++++++++++++ ...Fix-symbol-counting-logic-by-looking.patch | 49 +++++++++++++ packages/kernel-5.15/kernel-5.15.spec | 4 + 3 files changed, 126 insertions(+) create mode 100644 packages/kernel-5.15/5001-kallsyms-Make-module_kallsyms_on_each_symbol-general.patch create mode 100644 packages/kernel-5.15/5002-tracing-kprobes-Fix-symbol-counting-logic-by-looking.patch diff --git a/packages/kernel-5.15/5001-kallsyms-Make-module_kallsyms_on_each_symbol-general.patch b/packages/kernel-5.15/5001-kallsyms-Make-module_kallsyms_on_each_symbol-general.patch new file mode 100644 index 00000000000..0b7c54e10c5 --- /dev/null +++ b/packages/kernel-5.15/5001-kallsyms-Make-module_kallsyms_on_each_symbol-general.patch @@ -0,0 +1,73 @@ +From 5d5e377de988002f0db05c90ef39010503c61cee Mon Sep 17 00:00:00 2001 +From: Jiri Olsa +Date: Tue, 25 Oct 2022 15:41:41 +0200 +Subject: [PATCH] kallsyms: Make module_kallsyms_on_each_symbol generally + available + +commit 73feb8d5fa3b755bb51077c0aabfb6aa556fd498 upstream. + +Making module_kallsyms_on_each_symbol generally available, so it +can be used outside CONFIG_LIVEPATCH option in following changes. + +Rather than adding another ifdef option let's make the function +generally available (when CONFIG_KALLSYMS and CONFIG_MODULES +options are defined). + +Cc: Christoph Hellwig +Acked-by: Song Liu +Signed-off-by: Jiri Olsa +Link: https://lore.kernel.org/r/20221025134148.3300700-2-jolsa@kernel.org +Signed-off-by: Alexei Starovoitov +Signed-off-by: Greg Kroah-Hartman +Stable-dep-of: 926fe783c8a6 ("tracing/kprobes: Fix symbol counting logic by looking at modules as well") +Signed-off-by: Markus Boehme +--- + include/linux/module.h | 9 +++++++++ + kernel/module.c | 2 -- + 2 files changed, 9 insertions(+), 2 deletions(-) + +diff --git a/include/linux/module.h b/include/linux/module.h +index c9f1200b2312..701c150485b2 100644 +--- a/include/linux/module.h ++++ b/include/linux/module.h +@@ -867,8 +867,17 @@ static inline bool module_sig_ok(struct module *module) + } + #endif /* CONFIG_MODULE_SIG */ + ++#if defined(CONFIG_MODULES) && defined(CONFIG_KALLSYMS) + int module_kallsyms_on_each_symbol(int (*fn)(void *, const char *, + struct module *, unsigned long), + void *data); ++#else ++static inline int module_kallsyms_on_each_symbol(int (*fn)(void *, const char *, ++ struct module *, unsigned long), ++ void *data) ++{ ++ return -EOPNOTSUPP; ++} ++#endif /* CONFIG_MODULES && CONFIG_KALLSYMS */ + + #endif /* _LINUX_MODULE_H */ +diff --git a/kernel/module.c b/kernel/module.c +index 3c90840133c0..ba9f2bb57889 100644 +--- a/kernel/module.c ++++ b/kernel/module.c +@@ -4482,7 +4482,6 @@ unsigned long module_kallsyms_lookup_name(const char *name) + return ret; + } + +-#ifdef CONFIG_LIVEPATCH + int module_kallsyms_on_each_symbol(int (*fn)(void *, const char *, + struct module *, unsigned long), + void *data) +@@ -4514,7 +4513,6 @@ int module_kallsyms_on_each_symbol(int (*fn)(void *, const char *, + mutex_unlock(&module_mutex); + return ret; + } +-#endif /* CONFIG_LIVEPATCH */ + #endif /* CONFIG_KALLSYMS */ + + static void cfi_init(struct module *mod) +-- +2.40.1 + diff --git a/packages/kernel-5.15/5002-tracing-kprobes-Fix-symbol-counting-logic-by-looking.patch b/packages/kernel-5.15/5002-tracing-kprobes-Fix-symbol-counting-logic-by-looking.patch new file mode 100644 index 00000000000..d7753b89a05 --- /dev/null +++ b/packages/kernel-5.15/5002-tracing-kprobes-Fix-symbol-counting-logic-by-looking.patch @@ -0,0 +1,49 @@ +From 7bc06ef49649ff064c6bc3825e047c500eea141a Mon Sep 17 00:00:00 2001 +From: Andrii Nakryiko +Date: Fri, 27 Oct 2023 16:31:26 -0700 +Subject: [PATCH] tracing/kprobes: Fix symbol counting logic by looking at + modules as well + +commit 926fe783c8a64b33997fec405cf1af3e61aed441 upstream. + +Recent changes to count number of matching symbols when creating +a kprobe event failed to take into account kernel modules. As such, it +breaks kprobes on kernel module symbols, by assuming there is no match. + +Fix this my calling module_kallsyms_on_each_symbol() in addition to +kallsyms_on_each_match_symbol() to perform a proper counting. + +Link: https://lore.kernel.org/all/20231027233126.2073148-1-andrii@kernel.org/ + +Cc: Francis Laniel +Cc: stable@vger.kernel.org +Cc: Masami Hiramatsu +Cc: Steven Rostedt +Fixes: b022f0c7e404 ("tracing/kprobes: Return EADDRNOTAVAIL when func matches several symbols") +Signed-off-by: Andrii Nakryiko +Acked-by: Song Liu +Signed-off-by: Masami Hiramatsu (Google) +Signed-off-by: Greg Kroah-Hartman +Signed-off-by: Hao Wei Tee +Signed-off-by: Greg Kroah-Hartman +Signed-off-by: Markus Boehme +--- + kernel/trace/trace_kprobe.c | 2 ++ + 1 file changed, 2 insertions(+) + +diff --git a/kernel/trace/trace_kprobe.c b/kernel/trace/trace_kprobe.c +index 1c565db2de7b..21aef22a8489 100644 +--- a/kernel/trace/trace_kprobe.c ++++ b/kernel/trace/trace_kprobe.c +@@ -735,6 +735,8 @@ static unsigned int number_of_same_symbols(char *func_name) + + kallsyms_on_each_symbol(count_symbols, &args); + ++ module_kallsyms_on_each_symbol(count_symbols, &args); ++ + return args.count; + } + +-- +2.40.1 + diff --git a/packages/kernel-5.15/kernel-5.15.spec b/packages/kernel-5.15/kernel-5.15.spec index c3f1dce9d09..296c15e4fdc 100644 --- a/packages/kernel-5.15/kernel-5.15.spec +++ b/packages/kernel-5.15/kernel-5.15.spec @@ -22,6 +22,10 @@ Patch1003: 1003-initramfs-unlink-INITRAMFS_FORCE-from-CMDLINE_-EXTEN.patch # Increase default of sysctl net.unix.max_dgram_qlen to 512. Patch1004: 1004-af_unix-increase-default-max_dgram_qlen-to-512.patch +# Backport fix for #3691. Needs to be upstreamed to 5.15 stable series. +Patch5001: 5001-kallsyms-Make-module_kallsyms_on_each_symbol-general.patch +Patch5002: 5002-tracing-kprobes-Fix-symbol-counting-logic-by-looking.patch + BuildRequires: bc BuildRequires: elfutils-devel BuildRequires: hostname