diff --git a/patches.suse/s390-mem_detect-fix-detect_memory-error-handling.patch b/patches.suse/s390-mem_detect-fix-detect_memory-error-handling.patch new file mode 100644 index 0000000..7b879f3 --- /dev/null +++ b/patches.suse/s390-mem_detect-fix-detect_memory-error-handling.patch @@ -0,0 +1,37 @@ +From: Vasily Gorbik +Date: Fri, 27 Jan 2023 14:03:07 +0100 +Subject: s390/mem_detect: fix detect_memory() error handling +Git-commit: 3400c35a4090704e6c465449616ab7e67a9209e7 +Patch-mainline: v6.3-rc1 +References: git-fixes bsc#1211691 + +Currently if for some reason sclp_early_read_info() fails, +sclp_early_get_memsize() will not set max_physmem_end and it +will stay uninitialized. Any garbage value other than 0 will lead +to detect_memory() taking wrong path or returning a garbage value +as max_physmem_end. To avoid that simply initialize max_physmem_end. + +Fixes: 73045a08cf55 ("s390: unify identity mapping limits handling") +Reported-by: Alexander Gordeev +Reviewed-by: Alexander Gordeev +Signed-off-by: Vasily Gorbik +Signed-off-by: Heiko Carstens +Acked-by: Miroslav Franc +--- + arch/s390/boot/mem_detect.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/arch/s390/boot/mem_detect.c b/arch/s390/boot/mem_detect.c +index 7fa1a32ea0f3..0a5821ef4f1f 100644 +--- a/arch/s390/boot/mem_detect.c ++++ b/arch/s390/boot/mem_detect.c +@@ -165,7 +165,7 @@ static void search_mem_end(void) + + unsigned long detect_memory(void) + { +- unsigned long max_physmem_end; ++ unsigned long max_physmem_end = 0; + + sclp_early_get_memsize(&max_physmem_end); + + diff --git a/series.conf b/series.conf index 5ec37fd..f254912 100644 --- a/series.conf +++ b/series.conf @@ -18885,6 +18885,7 @@ patches.suse/thermal-intel-intel_pch-Add-support-for-Wellsburg-PC.patch patches.suse/thermal-intel-powerclamp-Fix-cur_state-for-multi-pac.patch patches.suse/thermal-drivers-hisi-Drop-second-sensor-hi3660.patch + patches.suse/s390-mem_detect-fix-detect_memory-error-handling.patch patches.suse/arm64-cpufeature-Fix-field-sign-for-DIT-hwcap-detection.patch patches.suse/arm64-Avoid-repeated-AA64MMFR1_EL1-register-read-on-.patch patches.suse/ACPI-Don-t-build-ACPICA-with-Os.patch