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

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