Blame SOURCES/0009-arm64-Fix-for-st-_stext_vmlinux-not-initialized-when.patch

56ae9b
From b077c3569788f5eb5ddf85bf41026b452d253a90 Mon Sep 17 00:00:00 2001
56ae9b
From: Qianli Zhao <qianli.zhao@horizon.ai>
56ae9b
Date: Mon, 4 Jul 2022 16:40:01 +0800
56ae9b
Subject: [PATCH 09/28] arm64: Fix for st->_stext_vmlinux not initialized when
56ae9b
 set VA_BITS_ACTUAL
56ae9b
56ae9b
Setting st->_stext_vmlinux to UNINITIALIZED to search for "_stext"
56ae9b
from the vmlinux.  In the scenario where kaslr is disabled and
56ae9b
without vmcoreinfo, crash will get the wrong MODULES/VMALLOC ranges
56ae9b
and cause a failure in parsing a raw RAM dumpfile.
56ae9b
56ae9b
Signed-off-by: Qianli Zhao <qianli.zhao@horizon.ai>
56ae9b
Signed-off-by: Lianbo Jiang <lijiang@redhat.com>
56ae9b
---
56ae9b
 arm64.c | 8 ++++++++
56ae9b
 1 file changed, 8 insertions(+)
56ae9b
56ae9b
diff --git a/arm64.c b/arm64.c
56ae9b
index 0f615cf52bef..b6b7aa11f4fe 100644
56ae9b
--- a/arm64.c
56ae9b
+++ b/arm64.c
56ae9b
@@ -149,6 +149,14 @@ arm64_init(int when)
56ae9b
 
56ae9b
 		ms = machdep->machspec;
56ae9b
 
56ae9b
+		/*
56ae9b
+		 * The st->_stext_vmlinux is needed in arm64_init(PRE_GDB) when a
56ae9b
+		 * dumpfile does not have vmcoreinfo and we use -m vabits_actual
56ae9b
+		 * option, e.g. a raw RAM dumpfile.
56ae9b
+		 */
56ae9b
+		if (ms->VA_BITS_ACTUAL)
56ae9b
+			st->_stext_vmlinux = UNINITIALIZED;
56ae9b
+
56ae9b
 		if (!ms->kimage_voffset && STREQ(pc->live_memsrc, "/dev/crash"))
56ae9b
 			ioctl(pc->mfd, DEV_CRASH_ARCH_DATA, &ms->kimage_voffset);
56ae9b
 
56ae9b
-- 
56ae9b
2.37.1
56ae9b