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

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