From 5056176e52039609e12b1eec2592710edd8420b166e91338d4d4cd7608495af1 Mon Sep 17 00:00:00 2001 From: Tony Jones Date: Thu, 27 Mar 2014 15:19:42 +0000 Subject: [PATCH 1/2] Accepting request 227786 from home:jones_tony:branches:Kernel:kdump OBS-URL: https://build.opensuse.org/request/show/227786 OBS-URL: https://build.opensuse.org/package/show/Kernel:kdump/kexec-tools?expand=0&rev=41 --- ...atory-disabling-gcc-stack-protection.patch | 31 +++++++++++ kexec-tools-zero-efi-info.patch | 54 +++++++++++++++++++ kexec-tools.changes | 6 +++ kexec-tools.spec | 6 ++- 4 files changed, 96 insertions(+), 1 deletion(-) create mode 100644 kexec-tools-ppc64-purgatory-disabling-gcc-stack-protection.patch create mode 100644 kexec-tools-zero-efi-info.patch diff --git a/kexec-tools-ppc64-purgatory-disabling-gcc-stack-protection.patch b/kexec-tools-ppc64-purgatory-disabling-gcc-stack-protection.patch new file mode 100644 index 0000000..269a6d3 --- /dev/null +++ b/kexec-tools-ppc64-purgatory-disabling-gcc-stack-protection.patch @@ -0,0 +1,31 @@ +From: Laurent Dufour +Date: Tue, 25 Mar 2014 10:55:53 +0100 +Subject: [PATCH] ppc64/purgatory: Disabling GCC's stack protection + +Some Linux distributions, like Suse, are turning on the GCC's stack +protection mechanism by default (-fstack-protector). When building the +purgatory with this option, this leads to link issues that are revealed at +runtime when the purgatory is loaded because symbols like __stack_chk_fail +are unresolved. + +This patch forces this stack protection mechanism to be turned off when +building the purgatory on ppc64 BE and LE. + +Signed-off-by: Laurent Dufour +--- + purgatory/arch/ppc64/Makefile | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/purgatory/arch/ppc64/Makefile b/purgatory/arch/ppc64/Makefile +index 31076e9..712e2b1 100644 +--- a/purgatory/arch/ppc64/Makefile ++++ b/purgatory/arch/ppc64/Makefile +@@ -9,7 +9,7 @@ ppc64_PURGATORY_SRCS += purgatory/arch/ppc64/console-ppc64.c + ppc64_PURGATORY_SRCS += purgatory/arch/ppc64/crashdump_backup.c + ppc64_PURGATORY_SRCS += purgatory/arch/ppc64/misc.S + +-ppc64_PURGATORY_EXTRA_CFLAGS += -m64 -msoft-float ++ppc64_PURGATORY_EXTRA_CFLAGS += -m64 -msoft-float -fno-stack-protector + ppc64_PURGATORY_EXTRA_ASFLAGS += -m64 + ifeq ($(SUBARCH),BE) + ppc64_PURGATORY_EXTRA_LDFLAGS += -melf64ppc diff --git a/kexec-tools-zero-efi-info.patch b/kexec-tools-zero-efi-info.patch new file mode 100644 index 0000000..d2b2595 --- /dev/null +++ b/kexec-tools-zero-efi-info.patch @@ -0,0 +1,54 @@ +From: Tony Jones +Subject: Disable erroneous efi memory descriptor version message +References: bnc#867785c5 +Upstream: not yet + +On non-EFI systems, efi_info section of boot_params is zero filled resulting +in an erroneous message from kexec regarding "efi memory descriptor" version. + +Caused by commit: e1ffc9e9a0769e1f54185003102e9bec428b84e8 "Passing efi related +data via setup_data" + +# od -j 448 -N 32 -v -x /sys/kernel/boot_params/data +0000700 0000 0000 0000 0000 0000 0000 0000 0000 +0000720 0000 0000 0000 0000 0000 0000 0000 0000 +0000740 + +# kexec -l --reuse-cmdline --initrd=/boot/initrd-`uname -r` /boot/vmlinuz-`uname -r` +efi memory descriptor version 0 is not supported! + +--- + kexec/arch/i386/x86-linux-setup.c | 14 +++++++++++--- + 1 file changed, 11 insertions(+), 3 deletions(-) + +--- a/kexec/arch/i386/x86-linux-setup.c ++++ b/kexec/arch/i386/x86-linux-setup.c +@@ -687,17 +687,25 @@ static void setup_efi_info(struct kexec_ + ret = get_bootparam(&real_mode->efi_info, offset, 32); + if (ret) + return; ++ if (((struct efi_info *)real_mode->efi_info)->efi_memmap_size == 0) ++ /* zero filled efi_info */ ++ goto out; + desc_version = get_efi_mem_desc_version(real_mode); + if (desc_version != 1) { + fprintf(stderr, + "efi memory descriptor version %d is not supported!\n", + desc_version); +- memset(&real_mode->efi_info, 0, 32); +- return; ++ goto out; + } + ret = setup_efi_data(info, real_mode); + if (ret) +- memset(&real_mode->efi_info, 0, 32); ++ goto out; ++ ++ return; ++ ++out: ++ memset(&real_mode->efi_info, 0, 32); ++ return; + } + + void setup_linux_system_parameters(struct kexec_info *info, diff --git a/kexec-tools.changes b/kexec-tools.changes index 47e342f..20019ae 100644 --- a/kexec-tools.changes +++ b/kexec-tools.changes @@ -1,3 +1,9 @@ +------------------------------------------------------------------- +Tue Mar 18 16:45:14 UTC 2014 - tonyj@suse.com + +- Disable stack protector for ppc64le (bnc#869161) +- Disable erroneous (efi memory descriptor version" message (bnc#867785c5) + ------------------------------------------------------------------- Thu Feb 6 01:14:24 UTC 2014 - tonyj@suse.com diff --git a/kexec-tools.spec b/kexec-tools.spec index e75323e..1874c60 100644 --- a/kexec-tools.spec +++ b/kexec-tools.spec @@ -40,6 +40,8 @@ Patch4: %{name}-enable-aarch64.patch Patch5: %{name}-xen-e820-redefinition.patch Patch6: %{name}-enable-aarch64-fixup.patch Patch7: %{name}-i386-bzimage_efi.patch +Patch8: %{name}-ppc64-purgatory-disabling-gcc-stack-protection.patch +Patch9: %{name}-zero-efi-info.patch Url: ftp://kernel.org/pub/linux/utils/kernel/kexec/%{name}-%{version}.tar.bz2 BuildRoot: %{_tmppath}/%{name}-%{version}-build #!BuildIgnore: fop @@ -67,12 +69,14 @@ the loaded kernel after it panics. %patch5 -p1 %patch6 -p1 %patch7 -p1 +%patch8 -p1 +%patch9 -p1 %build # disable as-needed export SUSE_ASNEEDED=0 %{?suse_update_config -f} -%ifarch ia64 +%ifarch ia64 ppc64le RPM_OPT_FLAGS=$(echo $RPM_OPT_FLAGS | sed -e 's/-fstack-protector//') %endif autoreconf -f From 17d8ff87fbbce8d4dfc0e1cc1572b89c3952885b7f87c543204cd8c5072a95a4 Mon Sep 17 00:00:00 2001 From: Tony Jones Date: Fri, 28 Mar 2014 17:09:49 +0000 Subject: [PATCH 2/2] OBS-URL: https://build.opensuse.org/package/show/Kernel:kdump/kexec-tools?expand=0&rev=42 --- kexec-tools.changes | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/kexec-tools.changes b/kexec-tools.changes index 20019ae..0460ab9 100644 --- a/kexec-tools.changes +++ b/kexec-tools.changes @@ -2,7 +2,9 @@ Tue Mar 18 16:45:14 UTC 2014 - tonyj@suse.com - Disable stack protector for ppc64le (bnc#869161) -- Disable erroneous (efi memory descriptor version" message (bnc#867785c5) + New patch: kexec-tools-ppc64-purgatory-disabling-gcc-stack-protection.patch_ +- Disable erroneous (efi memory descriptor version message (bnc#867785c5) + New patch: kexec-tools-zero-efi-info.patch ------------------------------------------------------------------- Thu Feb 6 01:14:24 UTC 2014 - tonyj@suse.com