diff --git a/patches.suse/s390-kexec-fix-ipl-report-address-for-kdump.patch b/patches.suse/s390-kexec-fix-ipl-report-address-for-kdump.patch new file mode 100644 index 0000000..026fa24 --- /dev/null +++ b/patches.suse/s390-kexec-fix-ipl-report-address-for-kdump.patch @@ -0,0 +1,64 @@ +From c2337a40e04dde1692b5b0a46ecc59f89aaba8a1 Mon Sep 17 00:00:00 2001 +From: Alexander Egorenkov +Date: Mon, 14 Nov 2022 11:40:08 +0100 +Subject: [PATCH] s390/kexec: fix ipl report address for kdump +References: bsc#1207529 +Git-commit: c2337a40e04dde1692b5b0a46ecc59f89aaba8a1 +Patch-mainline: v6.2-rc4 + +This commit addresses the following erroneous situation with file-based +kdump executed on a system with a valid IPL report. + +On s390, a kdump kernel, its initrd and IPL report if present are loaded +into a special and reserved on boot memory region - crashkernel. When +a system crashes and kdump was activated before, the purgatory code +is entered first which swaps the crashkernel and [0 - crashkernel size] +memory regions. Only after that the kdump kernel is entered. For this +reason, the pointer to an IPL report in lowcore must point to the IPL report +after the swap and not to the address of the IPL report that was located in +crashkernel memory region before the swap. Failing to do so, makes the +kdump's decompressor try to read memory from the crashkernel memory region +which already contains the production's kernel memory. + +The situation described above caused spontaneous kdump failures/hangs +on systems where the Secure IPL is activated because on such systems +an IPL report is always present. In that case kdump's decompressor tried +to parse an IPL report which frequently lead to illegal memory accesses +because an IPL report contains addresses to various data. + +Cc: +Fixes: 99feaa717e55 ("s390/kexec_file: Create ipl report and pass to next kernel") +Reviewed-by: Vasily Gorbik +Signed-off-by: Alexander Egorenkov +Signed-off-by: Heiko Carstens +Signed-off-by: Thomas Abraham +--- + arch/s390/kernel/machine_kexec_file.c | 5 +++-- + 1 file changed, 3 insertions(+), 2 deletions(-) + +diff --git a/arch/s390/kernel/machine_kexec_file.c b/arch/s390/kernel/machine_kexec_file.c +index fc6d5f58debe..2df94d32140c 100644 +--- a/arch/s390/kernel/machine_kexec_file.c ++++ b/arch/s390/kernel/machine_kexec_file.c +@@ -187,8 +187,6 @@ static int kexec_file_add_ipl_report(struct kimage *image, + + data->memsz = ALIGN(data->memsz, PAGE_SIZE); + buf.mem = data->memsz; +- if (image->type == KEXEC_TYPE_CRASH) +- buf.mem += crashk_res.start; + + ptr = (void *)ipl_cert_list_addr; + end = ptr + ipl_cert_list_size; +@@ -225,6 +223,9 @@ static int kexec_file_add_ipl_report(struct kimage *image, + data->kernel_buf + offsetof(struct lowcore, ipl_parmblock_ptr); + *lc_ipl_parmblock_ptr = (__u32)buf.mem; + ++ if (image->type == KEXEC_TYPE_CRASH) ++ buf.mem += crashk_res.start; ++ + ret = kexec_add_buffer(&buf); + out: + return ret; +-- +2.35.3 + diff --git a/series.conf b/series.conf index 5d70e6d..3991b09 100644 --- a/series.conf +++ b/series.conf @@ -36742,6 +36742,7 @@ patches.suse/scsi-mpi3mr-Refer-CONFIG_SCSI_MPI3MR-in-Makefile.patch patches.suse/scsi-mpt3sas-Remove-usage-of-dma_get_required_mask-A.patch patches.suse/regulator-da9211-Use-irq-handler-when-ready.patch + patches.suse/s390-kexec-fix-ipl-report-address-for-kdump.patch patches.suse/nfc-pn533-Wait-for-out_urb-s-completion-in-pn533_usb.patch patches.suse/net-sched-disallow-noqueue-for-qdisc-classes.patch patches.suse/drm-virtio-Fix-GEM-handle-creation-UAF.patch