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

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