File crash-s390-autodetect-kaslr.patch of Package crash.16727

Fix to allow live system analysis of s390x kernels that have been
configured with CONFIG_RANDOMIZE_BASE=y (KASLR).  Without the patch,
the "--kaslr=<offset>" command line option is required.
(anderson@redhat.com)
---
Index: b/symbols.c
===================================================================
--- a/symbols.c
+++ b/symbols.c
@@ -613,6 +613,12 @@ kaslr_init(void)
 		st->_stext_vmlinux = UNINITIALIZED;
 	}
 
+	if (machine_type("S390X") &&  /* Linux 5.2 */
+	    (symbol_value_from_proc_kallsyms("__kaslr_offset") != BADVAL)) {
+		kt->flags2 |= (RELOC_AUTO|KASLR);
+		st->_stext_vmlinux = UNINITIALIZED;
+	}
+
 	if (KDUMP_DUMPFILE() || DISKDUMP_DUMPFILE()) {
 		if ((string = pc->read_vmcoreinfo("SYMBOL(_stext)"))) {
 			kt->vmcoreinfo._stext_SYMBOL =
openSUSE Build Service is sponsored by