[PATCH] ppc64: fix crash load failure

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Crash tool will fail to load vmcore with the following error:

 #crash vmlinux /var/crash/127.0.0.1-2023-06-07-22\:03\:24/vmcore -s
  crash: invalid structure size: note_buf
         FILE: diskdump.c  LINE: 121  FUNCTION: have_crash_notes()

  [./crash] error trace: 101859ac => 10291798 => 10291450 => 10266038

    10266038: SIZE_verify+156
    10291450: have_crash_notes+308
    10291798: map_cpus_to_prstatus_kdump_cmprs+448
    101859ac: task_init+11980

The reason is that the note_buf is not intialized before using the
SIZE(note_buf) in the have_crash_notes(). Let's initialize the variable
note_buf in the ppc64_init() to fix this issue.

Fixes: db8c030857b4 ("diskdump/netdump: fix segmentation fault caused by failure of stopping CPUs")
Signed-off-by: Lianbo Jiang <lijiang@xxxxxxxxxx>
---
 ppc64.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/ppc64.c b/ppc64.c
index b95a621d8fe4..ff7f0fca3a95 100644
--- a/ppc64.c
+++ b/ppc64.c
@@ -695,6 +695,7 @@ ppc64_init(int when)
 		}
 
 		ppc64_init_paca_info();
+		STRUCT_SIZE_INIT(note_buf, "note_buf_t");
 
 		if (!machdep->hz) {
 			machdep->hz = HZ;
-- 
2.37.1

--
Crash-utility mailing list
Crash-utility@xxxxxxxxxx
https://listman.redhat.com/mailman/listinfo/crash-utility
Contribution Guidelines: https://github.com/crash-utility/crash/wiki




[Index of Archives]     [Fedora Development]     [Fedora Desktop]     [Fedora SELinux]     [Yosemite News]     [KDE Users]     [Fedora Tools]

 

Powered by Linux