From: Greg Kroah-Hartman Date: Wed, 27 Oct 2021 16:10:24 +0000 (+0200) Subject: 4.9-stable patches X-Git-Tag: v4.4.291~53 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=44accdecd765149ca2c4202c7ed1123082ef9e8b;p=thirdparty%2Fkernel%2Fstable-queue.git 4.9-stable patches added patches: arm-9133-1-mm-proc-macros-ensure-_tlb_fns-are-4b-aligned.patch arm-9134-1-remove-duplicate-memcpy-definition.patch arm-9139-1-kprobes-fix-arch_init_kprobes-prototype.patch --- diff --git a/queue-4.9/arm-9133-1-mm-proc-macros-ensure-_tlb_fns-are-4b-aligned.patch b/queue-4.9/arm-9133-1-mm-proc-macros-ensure-_tlb_fns-are-4b-aligned.patch new file mode 100644 index 00000000000..7f891bca781 --- /dev/null +++ b/queue-4.9/arm-9133-1-mm-proc-macros-ensure-_tlb_fns-are-4b-aligned.patch @@ -0,0 +1,41 @@ +From e6a0c958bdf9b2e1b57501fc9433a461f0a6aadd Mon Sep 17 00:00:00 2001 +From: Nick Desaulniers +Date: Mon, 4 Oct 2021 18:03:28 +0100 +Subject: ARM: 9133/1: mm: proc-macros: ensure *_tlb_fns are 4B aligned + +From: Nick Desaulniers + +commit e6a0c958bdf9b2e1b57501fc9433a461f0a6aadd upstream. + +A kernel built with CONFIG_THUMB2_KERNEL=y and using clang as the +assembler could generate non-naturally-aligned v7wbi_tlb_fns which +results in a boot failure. The original commit adding the macro missed +the .align directive on this data. + +Link: https://github.com/ClangBuiltLinux/linux/issues/1447 +Link: https://lore.kernel.org/all/0699da7b-354f-aecc-a62f-e25693209af4@linaro.org/ +Debugged-by: Ard Biesheuvel +Debugged-by: Nathan Chancellor +Debugged-by: Richard Henderson + +Fixes: 66a625a88174 ("ARM: mm: proc-macros: Add generic proc/cache/tlb struct definition macros") +Suggested-by: Ard Biesheuvel +Acked-by: Ard Biesheuvel +Signed-off-by: Nick Desaulniers +Tested-by: Nathan Chancellor +Signed-off-by: Russell King (Oracle) +Signed-off-by: Greg Kroah-Hartman +--- + arch/arm/mm/proc-macros.S | 1 + + 1 file changed, 1 insertion(+) + +--- a/arch/arm/mm/proc-macros.S ++++ b/arch/arm/mm/proc-macros.S +@@ -343,6 +343,7 @@ ENTRY(\name\()_cache_fns) + + .macro define_tlb_functions name:req, flags_up:req, flags_smp + .type \name\()_tlb_fns, #object ++ .align 2 + ENTRY(\name\()_tlb_fns) + .long \name\()_flush_user_tlb_range + .long \name\()_flush_kern_tlb_range diff --git a/queue-4.9/arm-9134-1-remove-duplicate-memcpy-definition.patch b/queue-4.9/arm-9134-1-remove-duplicate-memcpy-definition.patch new file mode 100644 index 00000000000..5599529dff7 --- /dev/null +++ b/queue-4.9/arm-9134-1-remove-duplicate-memcpy-definition.patch @@ -0,0 +1,56 @@ +From eaf6cc7165c9c5aa3c2f9faa03a98598123d0afb Mon Sep 17 00:00:00 2001 +From: Arnd Bergmann +Date: Mon, 18 Oct 2021 15:30:04 +0100 +Subject: ARM: 9134/1: remove duplicate memcpy() definition + +From: Arnd Bergmann + +commit eaf6cc7165c9c5aa3c2f9faa03a98598123d0afb upstream. + +Both the decompressor code and the kasan logic try to override +the memcpy() and memmove() definitions, which leading to a clash +in a KASAN-enabled kernel with XZ decompression: + +arch/arm/boot/compressed/decompress.c:50:9: error: 'memmove' macro redefined [-Werror,-Wmacro-redefined] + #define memmove memmove + ^ +arch/arm/include/asm/string.h:59:9: note: previous definition is here + #define memmove(dst, src, len) __memmove(dst, src, len) + ^ +arch/arm/boot/compressed/decompress.c:51:9: error: 'memcpy' macro redefined [-Werror,-Wmacro-redefined] + #define memcpy memcpy + ^ +arch/arm/include/asm/string.h:58:9: note: previous definition is here + #define memcpy(dst, src, len) __memcpy(dst, src, len) + ^ + +Here we want the set of functions from the decompressor, so undefine +the other macros before the override. + +Link: https://lore.kernel.org/linux-arm-kernel/CACRpkdZYJogU_SN3H9oeVq=zJkRgRT1gDz3xp59gdqWXxw-B=w@mail.gmail.com/ +Link: https://lore.kernel.org/lkml/202105091112.F5rmd4By-lkp@intel.com/ + +Fixes: d6d51a96c7d6 ("ARM: 9014/2: Replace string mem* functions for KASan") +Fixes: a7f464f3db93 ("ARM: 7001/2: Wire up support for the XZ decompressor") +Reported-by: kernel test robot +Reviewed-by: Linus Walleij +Signed-off-by: Arnd Bergmann +Signed-off-by: Russell King (Oracle) +Signed-off-by: Greg Kroah-Hartman +--- + arch/arm/boot/compressed/decompress.c | 3 +++ + 1 file changed, 3 insertions(+) + +--- a/arch/arm/boot/compressed/decompress.c ++++ b/arch/arm/boot/compressed/decompress.c +@@ -46,7 +46,10 @@ extern char * strstr(const char * s1, co + #endif + + #ifdef CONFIG_KERNEL_XZ ++/* Prevent KASAN override of string helpers in decompressor */ ++#undef memmove + #define memmove memmove ++#undef memcpy + #define memcpy memcpy + #include "../../../../lib/decompress_unxz.c" + #endif diff --git a/queue-4.9/arm-9139-1-kprobes-fix-arch_init_kprobes-prototype.patch b/queue-4.9/arm-9139-1-kprobes-fix-arch_init_kprobes-prototype.patch new file mode 100644 index 00000000000..2504f74b289 --- /dev/null +++ b/queue-4.9/arm-9139-1-kprobes-fix-arch_init_kprobes-prototype.patch @@ -0,0 +1,38 @@ +From 1f323127cab086e4fd618981b1e5edc396eaf0f4 Mon Sep 17 00:00:00 2001 +From: Arnd Bergmann +Date: Mon, 18 Oct 2021 15:30:09 +0100 +Subject: ARM: 9139/1: kprobes: fix arch_init_kprobes() prototype + +From: Arnd Bergmann + +commit 1f323127cab086e4fd618981b1e5edc396eaf0f4 upstream. + +With extra warnings enabled, gcc complains about this function +definition: + +arch/arm/probes/kprobes/core.c: In function 'arch_init_kprobes': +arch/arm/probes/kprobes/core.c:465:12: warning: old-style function definition [-Wold-style-definition] + 465 | int __init arch_init_kprobes() + +Link: https://lore.kernel.org/all/20201027093057.c685a14b386acacb3c449e3d@kernel.org/ + +Fixes: 24ba613c9d6c ("ARM kprobes: core code") +Acked-by: Masami Hiramatsu +Signed-off-by: Arnd Bergmann +Signed-off-by: Russell King (Oracle) +Signed-off-by: Greg Kroah-Hartman +--- + arch/arm/probes/kprobes/core.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +--- a/arch/arm/probes/kprobes/core.c ++++ b/arch/arm/probes/kprobes/core.c +@@ -666,7 +666,7 @@ static struct undef_hook kprobes_arm_bre + + #endif /* !CONFIG_THUMB2_KERNEL */ + +-int __init arch_init_kprobes() ++int __init arch_init_kprobes(void) + { + arm_probes_decode_init(); + #ifdef CONFIG_THUMB2_KERNEL