diff options
3 files changed, 103 insertions, 0 deletions
diff --git a/queue-5.15/s390-add-std-gnu11-to-decompressor-and-purgatory-cflags.patch b/queue-5.15/s390-add-std-gnu11-to-decompressor-and-purgatory-cflags.patch new file mode 100644 index 0000000000..c0a96c7a8c --- /dev/null +++ b/queue-5.15/s390-add-std-gnu11-to-decompressor-and-purgatory-cflags.patch @@ -0,0 +1,64 @@ +From 3b8b80e993766dc96d1a1c01c62f5d15fafc79b9 Mon Sep 17 00:00:00 2001 +From: Nathan Chancellor <nathan@kernel.org> +Date: Wed, 22 Jan 2025 19:54:27 -0700 +Subject: s390: Add '-std=gnu11' to decompressor and purgatory CFLAGS + +From: Nathan Chancellor <nathan@kernel.org> + +commit 3b8b80e993766dc96d1a1c01c62f5d15fafc79b9 upstream. + +GCC changed the default C standard dialect from gnu17 to gnu23, +which should not have impacted the kernel because it explicitly requests +the gnu11 standard in the main Makefile. However, there are certain +places in the s390 code that use their own CFLAGS without a '-std=' +value, which break with this dialect change because of the kernel's own +definitions of bool, false, and true conflicting with the C23 reserved +keywords. + + include/linux/stddef.h:11:9: error: cannot use keyword 'false' as enumeration constant + 11 | false = 0, + | ^~~~~ + include/linux/stddef.h:11:9: note: 'false' is a keyword with '-std=c23' onwards + include/linux/types.h:35:33: error: 'bool' cannot be defined via 'typedef' + 35 | typedef _Bool bool; + | ^~~~ + include/linux/types.h:35:33: note: 'bool' is a keyword with '-std=c23' onwards + +Add '-std=gnu11' to the decompressor and purgatory CFLAGS to eliminate +these errors and make the C standard version of these areas match the +rest of the kernel. + +Cc: stable@vger.kernel.org +Signed-off-by: Nathan Chancellor <nathan@kernel.org> +Tested-by: Heiko Carstens <hca@linux.ibm.com> +Link: https://lore.kernel.org/r/20250122-s390-fix-std-for-gcc-15-v1-1-8b00cadee083@kernel.org +Signed-off-by: Alexander Gordeev <agordeev@linux.ibm.com> +Signed-off-by: Heiko Carstens <hca@linux.ibm.com> +Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org> +--- + arch/s390/Makefile | 2 +- + arch/s390/purgatory/Makefile | 2 +- + 2 files changed, 2 insertions(+), 2 deletions(-) + +--- a/arch/s390/Makefile ++++ b/arch/s390/Makefile +@@ -23,7 +23,7 @@ endif + aflags_dwarf := -Wa,-gdwarf-2 + KBUILD_AFLAGS_DECOMPRESSOR := $(CLANG_FLAGS) -m64 -D__ASSEMBLY__ + KBUILD_AFLAGS_DECOMPRESSOR += $(if $(CONFIG_DEBUG_INFO),$(aflags_dwarf)) +-KBUILD_CFLAGS_DECOMPRESSOR := $(CLANG_FLAGS) -m64 -O2 ++KBUILD_CFLAGS_DECOMPRESSOR := $(CLANG_FLAGS) -m64 -O2 -std=gnu11 + KBUILD_CFLAGS_DECOMPRESSOR += -DDISABLE_BRANCH_PROFILING -D__NO_FORTIFY + KBUILD_CFLAGS_DECOMPRESSOR += -fno-delete-null-pointer-checks -msoft-float -mbackchain + KBUILD_CFLAGS_DECOMPRESSOR += -fno-asynchronous-unwind-tables +--- a/arch/s390/purgatory/Makefile ++++ b/arch/s390/purgatory/Makefile +@@ -21,7 +21,7 @@ UBSAN_SANITIZE := n + KASAN_SANITIZE := n + KCSAN_SANITIZE := n + +-KBUILD_CFLAGS := -fno-strict-aliasing -Wall -Wstrict-prototypes ++KBUILD_CFLAGS := -std=gnu11 -fno-strict-aliasing -Wall -Wstrict-prototypes + KBUILD_CFLAGS += -Wno-pointer-sign -Wno-sign-compare + KBUILD_CFLAGS += -fno-zero-initialized-in-bss -fno-builtin -ffreestanding + KBUILD_CFLAGS += -c -MD -Os -m64 -msoft-float -fno-common diff --git a/queue-5.15/s390-entry-fix-last-breaking-event-handling-in-case-of-stack-corruption.patch b/queue-5.15/s390-entry-fix-last-breaking-event-handling-in-case-of-stack-corruption.patch new file mode 100644 index 0000000000..ae1de77e69 --- /dev/null +++ b/queue-5.15/s390-entry-fix-last-breaking-event-handling-in-case-of-stack-corruption.patch @@ -0,0 +1,37 @@ +From ae952eea6f4a7e2193f8721a5366049946e012e7 Mon Sep 17 00:00:00 2001 +From: Heiko Carstens <hca@linux.ibm.com> +Date: Thu, 24 Apr 2025 17:07:01 +0200 +Subject: s390/entry: Fix last breaking event handling in case of stack corruption + +From: Heiko Carstens <hca@linux.ibm.com> + +commit ae952eea6f4a7e2193f8721a5366049946e012e7 upstream. + +In case of stack corruption stack_invalid() is called and the expectation +is that register r10 contains the last breaking event address. This +dependency is quite subtle and broke a couple of years ago without that +anybody noticed. + +Fix this by getting rid of the dependency and read the last breaking event +address from lowcore. + +Fixes: 56e62a737028 ("s390: convert to generic entry") +Acked-by: Ilya Leoshkevich <iii@linux.ibm.com> +Reviewed-by: Alexander Gordeev <agordeev@linux.ibm.com> +Signed-off-by: Heiko Carstens <hca@linux.ibm.com> +Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org> +--- + arch/s390/kernel/entry.S | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +--- a/arch/s390/kernel/entry.S ++++ b/arch/s390/kernel/entry.S +@@ -676,7 +676,7 @@ ENTRY(stack_overflow) + stmg %r0,%r7,__PT_R0(%r11) + stmg %r8,%r9,__PT_PSW(%r11) + mvc __PT_R8(64,%r11),0(%r14) +- stg %r10,__PT_ORIG_GPR2(%r11) # store last break to orig_gpr2 ++ mvc __PT_ORIG_GPR2(8,%r11),__LC_LAST_BREAK + xc __SF_BACKCHAIN(8,%r15),__SF_BACKCHAIN(%r15) + lgr %r2,%r11 # pass pointer to pt_regs + jg kernel_stack_overflow diff --git a/queue-5.15/series b/queue-5.15/series index 92c1aec35b..a6edf3754a 100644 --- a/queue-5.15/series +++ b/queue-5.15/series @@ -89,3 +89,5 @@ drm-bridge-cdns-dsi-wait-for-clk-and-data-lanes-to-be-ready.patch drm-amd-display-add-null-pointer-check-for-get_first_active_display.patch pci-hv-do-not-set-pci_command_memory-to-reduce-vm-boot-time.patch media-uvcvideo-rollback-non-processed-entities-on-error.patch +s390-entry-fix-last-breaking-event-handling-in-case-of-stack-corruption.patch +s390-add-std-gnu11-to-decompressor-and-purgatory-cflags.patch |