From: Sasha Levin Date: Sat, 2 Nov 2024 11:11:43 +0000 (-0400) Subject: Fixes for 5.10 X-Git-Tag: v4.19.323~113 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=e9976deeb1893bc26ac5886110d9c5e1b26cc0c4;p=thirdparty%2Fkernel%2Fstable-queue.git Fixes for 5.10 Signed-off-by: Sasha Levin --- diff --git a/queue-5.10/compiler-gcc-be-consistent-with-underscores-use-for-.patch b/queue-5.10/compiler-gcc-be-consistent-with-underscores-use-for-.patch new file mode 100644 index 00000000000..eb96f15169b --- /dev/null +++ b/queue-5.10/compiler-gcc-be-consistent-with-underscores-use-for-.patch @@ -0,0 +1,73 @@ +From 74f608d42cfe34c504e256616f974e44f9dc7946 Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Fri, 21 Oct 2022 13:59:52 +0200 +Subject: compiler-gcc: be consistent with underscores use for `no_sanitize` + +From: Miguel Ojeda + +[ Upstream commit 6e2be1f2ebcea42ed6044432f72f32434e60b34d ] + +Patch series "compiler-gcc: be consistent with underscores use for +`no_sanitize`". + +This patch (of 5): + +Other macros that define shorthands for attributes in e.g. +`compiler_attributes.h` and elsewhere use underscores. + +Link: https://lkml.kernel.org/r/20221021115956.9947-1-ojeda@kernel.org +Signed-off-by: Miguel Ojeda +Reviewed-by: Nathan Chancellor +Cc: Marco Elver +Cc: Alexander Potapenko +Cc: Andrey Konovalov +Cc: Arnd Bergmann +Cc: Dan Li +Cc: Kees Cook +Cc: Kumar Kartikeya Dwivedi +Cc: Nick Desaulniers +Cc: Uros Bizjak +Signed-off-by: Andrew Morton +Stable-dep-of: 894b00a3350c ("kasan: Fix Software Tag-Based KASAN with GCC") +Signed-off-by: Sasha Levin +--- + include/linux/compiler-gcc.h | 8 ++++---- + 1 file changed, 4 insertions(+), 4 deletions(-) + +diff --git a/include/linux/compiler-gcc.h b/include/linux/compiler-gcc.h +index ae2de4e1cd6fa..f8333dab22fa8 100644 +--- a/include/linux/compiler-gcc.h ++++ b/include/linux/compiler-gcc.h +@@ -117,25 +117,25 @@ + #endif + + #if __has_attribute(__no_sanitize_address__) +-#define __no_sanitize_address __attribute__((no_sanitize_address)) ++#define __no_sanitize_address __attribute__((__no_sanitize_address__)) + #else + #define __no_sanitize_address + #endif + + #if defined(__SANITIZE_THREAD__) && __has_attribute(__no_sanitize_thread__) +-#define __no_sanitize_thread __attribute__((no_sanitize_thread)) ++#define __no_sanitize_thread __attribute__((__no_sanitize_thread__)) + #else + #define __no_sanitize_thread + #endif + + #if __has_attribute(__no_sanitize_undefined__) +-#define __no_sanitize_undefined __attribute__((no_sanitize_undefined)) ++#define __no_sanitize_undefined __attribute__((__no_sanitize_undefined__)) + #else + #define __no_sanitize_undefined + #endif + + #if defined(CONFIG_KCOV) && __has_attribute(__no_sanitize_coverage__) +-#define __no_sanitize_coverage __attribute__((no_sanitize_coverage)) ++#define __no_sanitize_coverage __attribute__((__no_sanitize_coverage__)) + #else + #define __no_sanitize_coverage + #endif +-- +2.43.0 + diff --git a/queue-5.10/compiler-gcc-remove-attribute-support-check-for-__no.patch b/queue-5.10/compiler-gcc-remove-attribute-support-check-for-__no.patch new file mode 100644 index 00000000000..3628b70698c --- /dev/null +++ b/queue-5.10/compiler-gcc-remove-attribute-support-check-for-__no.patch @@ -0,0 +1,54 @@ +From ac1c454e6ce6a35d5ba68b058e54425ea28e3ede Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Fri, 21 Oct 2022 13:59:53 +0200 +Subject: compiler-gcc: remove attribute support check for + `__no_sanitize_address__` + +From: Miguel Ojeda + +[ Upstream commit ae37a9a2c2d0960d643d782b426ea1aa9c05727a ] + +The attribute was added in GCC 4.8, while the minimum GCC version +supported by the kernel is GCC 5.1. + +Therefore, remove the check. + +Link: https://godbolt.org/z/84v56vcn8 +Link: https://lkml.kernel.org/r/20221021115956.9947-2-ojeda@kernel.org +Signed-off-by: Miguel Ojeda +Reviewed-by: Nathan Chancellor +Cc: Alexander Potapenko +Cc: Andrey Konovalov +Cc: Arnd Bergmann +Cc: Dan Li +Cc: Kees Cook +Cc: Kumar Kartikeya Dwivedi +Cc: Marco Elver +Cc: Nick Desaulniers +Cc: Uros Bizjak +Signed-off-by: Andrew Morton +Stable-dep-of: 894b00a3350c ("kasan: Fix Software Tag-Based KASAN with GCC") +Signed-off-by: Sasha Levin +--- + include/linux/compiler-gcc.h | 4 ---- + 1 file changed, 4 deletions(-) + +diff --git a/include/linux/compiler-gcc.h b/include/linux/compiler-gcc.h +index f8333dab22fa8..bf78da28e8427 100644 +--- a/include/linux/compiler-gcc.h ++++ b/include/linux/compiler-gcc.h +@@ -116,11 +116,7 @@ + #define KASAN_ABI_VERSION 3 + #endif + +-#if __has_attribute(__no_sanitize_address__) + #define __no_sanitize_address __attribute__((__no_sanitize_address__)) +-#else +-#define __no_sanitize_address +-#endif + + #if defined(__SANITIZE_THREAD__) && __has_attribute(__no_sanitize_thread__) + #define __no_sanitize_thread __attribute__((__no_sanitize_thread__)) +-- +2.43.0 + diff --git a/queue-5.10/firmware-arm_sdei-fix-the-input-parameter-of-cpuhp_r.patch b/queue-5.10/firmware-arm_sdei-fix-the-input-parameter-of-cpuhp_r.patch new file mode 100644 index 00000000000..e7473714736 --- /dev/null +++ b/queue-5.10/firmware-arm_sdei-fix-the-input-parameter-of-cpuhp_r.patch @@ -0,0 +1,38 @@ +From 235de14e7a6ef93674f922c7ddddd5717d388b80 Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Wed, 16 Oct 2024 16:47:40 +0800 +Subject: firmware: arm_sdei: Fix the input parameter of cpuhp_remove_state() + +From: Xiongfeng Wang + +[ Upstream commit c83212d79be2c9886d3e6039759ecd388fd5fed1 ] + +In sdei_device_freeze(), the input parameter of cpuhp_remove_state() is +passed as 'sdei_entry_point' by mistake. Change it to 'sdei_hp_state'. + +Fixes: d2c48b2387eb ("firmware: arm_sdei: Fix sleep from invalid context BUG") +Signed-off-by: Xiongfeng Wang +Reviewed-by: James Morse +Link: https://lore.kernel.org/r/20241016084740.183353-1-wangxiongfeng2@huawei.com +Signed-off-by: Will Deacon +Signed-off-by: Sasha Levin +--- + drivers/firmware/arm_sdei.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/drivers/firmware/arm_sdei.c b/drivers/firmware/arm_sdei.c +index 68e55ca7491e5..b160851c524cf 100644 +--- a/drivers/firmware/arm_sdei.c ++++ b/drivers/firmware/arm_sdei.c +@@ -764,7 +764,7 @@ static int sdei_device_freeze(struct device *dev) + int err; + + /* unregister private events */ +- cpuhp_remove_state(sdei_entry_point); ++ cpuhp_remove_state(sdei_hp_state); + + err = sdei_unregister_shared(); + if (err) +-- +2.43.0 + diff --git a/queue-5.10/kasan-fix-software-tag-based-kasan-with-gcc.patch b/queue-5.10/kasan-fix-software-tag-based-kasan-with-gcc.patch new file mode 100644 index 00000000000..3687a50ffd2 --- /dev/null +++ b/queue-5.10/kasan-fix-software-tag-based-kasan-with-gcc.patch @@ -0,0 +1,53 @@ +From 213472ea3969decd3b4f829fd702bc49daeba9d2 Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Mon, 21 Oct 2024 14:00:10 +0200 +Subject: kasan: Fix Software Tag-Based KASAN with GCC + +From: Marco Elver + +[ Upstream commit 894b00a3350c560990638bdf89bdf1f3d5491950 ] + +Per [1], -fsanitize=kernel-hwaddress with GCC currently does not disable +instrumentation in functions with __attribute__((no_sanitize_address)). + +However, __attribute__((no_sanitize("hwaddress"))) does correctly +disable instrumentation. Use it instead. + +Link: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=117196 [1] +Link: https://lore.kernel.org/r/000000000000f362e80620e27859@google.com +Link: https://lore.kernel.org/r/ZvFGwKfoC4yVjN_X@J2N7QTR9R3 +Link: https://bugzilla.kernel.org/show_bug.cgi?id=218854 +Reported-by: syzbot+908886656a02769af987@syzkaller.appspotmail.com +Tested-by: Andrey Konovalov +Cc: Andrew Pinski +Cc: Mark Rutland +Cc: Will Deacon +Signed-off-by: Marco Elver +Reviewed-by: Andrey Konovalov +Fixes: 7b861a53e46b ("kasan: Bump required compiler version") +Link: https://lore.kernel.org/r/20241021120013.3209481-1-elver@google.com +Signed-off-by: Will Deacon +Signed-off-by: Sasha Levin +--- + include/linux/compiler-gcc.h | 4 ++++ + 1 file changed, 4 insertions(+) + +diff --git a/include/linux/compiler-gcc.h b/include/linux/compiler-gcc.h +index bf78da28e8427..5b481a22b5fe2 100644 +--- a/include/linux/compiler-gcc.h ++++ b/include/linux/compiler-gcc.h +@@ -116,7 +116,11 @@ + #define KASAN_ABI_VERSION 3 + #endif + ++#ifdef __SANITIZE_HWADDRESS__ ++#define __no_sanitize_address __attribute__((__no_sanitize__("hwaddress"))) ++#else + #define __no_sanitize_address __attribute__((__no_sanitize_address__)) ++#endif + + #if defined(__SANITIZE_THREAD__) && __has_attribute(__no_sanitize_thread__) + #define __no_sanitize_thread __attribute__((__no_sanitize_thread__)) +-- +2.43.0 + diff --git a/queue-5.10/series b/queue-5.10/series index 7e0d5035206..a3a75224ef7 100644 --- a/queue-5.10/series +++ b/queue-5.10/series @@ -76,3 +76,7 @@ net-support-ip-generic-csum-processing-in-skb_csum_h.patch net-skip-offload-for-netif_f_ipv6_csum-if-ipv6-heade.patch netfilter-nft_payload-sanitize-offset-and-length-bef.patch net-hns3-initialize-reset_timer-before-hclgevf_misc_.patch +compiler-gcc-be-consistent-with-underscores-use-for-.patch +compiler-gcc-remove-attribute-support-check-for-__no.patch +kasan-fix-software-tag-based-kasan-with-gcc.patch +firmware-arm_sdei-fix-the-input-parameter-of-cpuhp_r.patch