Blame SOURCES/0022-Fix-for-the-invalid-linux_banner-pointer-issue.patch

acf3ec
From 598377606649ee3cdcc1694d975bed27005612ee Mon Sep 17 00:00:00 2001
acf3ec
From: Lianbo Jiang <lijiang@redhat.com>
acf3ec
Date: Wed, 16 Nov 2022 20:46:48 +0800
acf3ec
Subject: [PATCH 22/28] Fix for the invalid linux_banner pointer issue
acf3ec
acf3ec
Currently, crash may fail with the following error:
acf3ec
acf3ec
  # ./crash -s vmlinux vmcore
acf3ec
  WARNING: invalid linux_banner pointer: 65762078756e694c
acf3ec
  crash: vmlinux and vmcore do not match!
acf3ec
acf3ec
The reason is that the type of the symbol in the data segment may be
acf3ec
defined as 'D' or 'd'. The crash only handled the type 'D', but it
acf3ec
didn't deal with the type 'd'. For example:
acf3ec
acf3ec
  # nm vmlinux | grep linux_banner
acf3ec
  ffffffff827cfa80 d linux_banner
acf3ec
acf3ec
It has been observed that a vmlinux compiled by clang has this type.
acf3ec
Let's add the type 'd' recognition to solve such issue.
acf3ec
acf3ec
Signed-off-by: Lianbo Jiang <lijiang@redhat.com>
acf3ec
---
acf3ec
 kernel.c | 1 +
acf3ec
 1 file changed, 1 insertion(+)
acf3ec
acf3ec
diff --git a/kernel.c b/kernel.c
acf3ec
index bd0bf8c6cf03..2a1c1c391414 100644
acf3ec
--- a/kernel.c
acf3ec
+++ b/kernel.c
acf3ec
@@ -1060,6 +1060,7 @@ verify_version(void)
acf3ec
 	if (!(sp = symbol_search("linux_banner")))
acf3ec
 		error(FATAL, "linux_banner symbol does not exist?\n");
acf3ec
 	else if ((sp->type == 'R') || (sp->type == 'r') ||
acf3ec
+		 (THIS_KERNEL_VERSION >= LINUX(2,6,11) && (sp->type == 'D' || sp->type == 'd')) ||
acf3ec
 		 (machine_type("ARM") && sp->type == 'T') ||
acf3ec
 		 (machine_type("ARM64")))
acf3ec
 		linux_banner = symbol_value("linux_banner");
acf3ec
-- 
acf3ec
2.37.1
acf3ec