Skip to contentSkip to conversation

New: Crashdump feature totally broken with CONFIG_KEXEC_JUMP

Bugme-new Andrew Morton 2 participants 2 messages May 7, 2009 – May 8, 2009 1 message not in the archive

Subsystems (3)
lore
Share & tools
lore

A message that is not in the archive (sent off-list or not yet received): [email protected]/

#1 lore raw

(switched to email. Please respond via emailed reply-to-all, not via the bugzilla web interface).

Quoted 27 lines · On Thu, 7 May 2009 13:29:41 GMT [email protected] wrote:

http://bugzilla.kernel.org/show_bug.cgi?id=13265

           Summary: Crashdump feature totally broken with
                    CONFIG_KEXEC_JUMP
           Product: Platform Specific/Hardware
           Version: 2.5
    Kernel Version: 2.6.30rc4
          Platform: All
        OS/Version: Linux
              Tree: Mainline
            Status: NEW
          Severity: normal
          Priority: P1
         Component: i386
        AssignedTo: [email protected]
        ReportedBy: [email protected]
        Regression: No

I loaded a crash kernel into a freshly-built 2.6.30rc4 instance using the Ubuntu scripts, and then triggered a crash with echo c > /proc/sysrq-trigger. The result was a kernel oops due to a null pointer deference in machine_kexec_32.c around line 197:

#ifdef CONFIG_KEXEC_JUMP
    if (kexec_image->preserve_context)
Quoted 8 lines

kexec_image is NULL in this situation because kexec_crash_image (a.k.a. the image parameter) is meant to be used instead. I tracked down the commit for you:

<http://git.kernel.org/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commitdiff;h=3122c331190e9d1622bf1c8cf6ce3b17cca67c9e>

Presumably the feature has been broken since that time.

_______________________________________________
kexec mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/kexec

#2 lore raw
Quoted 40 lines · Andrew Morton

(switched to email. Please respond via emailed reply-to-all, not via the bugzilla web interface).

Quoted 33 lines · On Thu, 7 May 2009 13:29:41 GMT [email protected] wrote:

http://bugzilla.kernel.org/show_bug.cgi?id=13265

           Summary: Crashdump feature totally broken with
                    CONFIG_KEXEC_JUMP
           Product: Platform Specific/Hardware
           Version: 2.5
    Kernel Version: 2.6.30rc4
          Platform: All
        OS/Version: Linux
              Tree: Mainline
            Status: NEW
          Severity: normal
          Priority: P1
         Component: i386
        AssignedTo: [email protected]
        ReportedBy: [email protected]
        Regression: No

I loaded a crash kernel into a freshly-built 2.6.30rc4 instance using the Ubuntu scripts, and then triggered a crash with echo c > /proc/sysrq-trigger. The result was a kernel oops due to a null pointer deference in machine_kexec_32.c around line 197:

#ifdef CONFIG_KEXEC_JUMP
    if (kexec_image->preserve_context)

kexec_image is NULL in this situation because kexec_crash_image (a.k.a. the image parameter) is meant to be used instead. I tracked down the commit for you:

<http://git.kernel.org/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commitdiff;h=3122c331190e9d1622bf1c8cf6ce3b17cca67c9e>

Quoted 9 lines
Quoted 2 lines

Presumably the feature has been broken since that time.

_______________________________________________
kexec mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/kexec

This should fix it

 machine_kexec_32.c |    2 +-
 machine_kexec_64.c |    2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)
arch/x86/kernel/machine_kexec_32.c +1 -1
index e7368c1..e3c8bd5 100644
@@ -194,7 +194,7 @@ void machine_kexec(struct kimage *image)
 				       unsigned int preserve_context);
 
 #ifdef CONFIG_KEXEC_JUMP
-	if (kexec_image->preserve_context)
+	if (image->preserve_context)
 		save_processor_state();
 #endif
 
arch/x86/kernel/machine_kexec_64.c +1 -1
index 89cea4d..416732c 100644
@@ -274,7 +274,7 @@ void machine_kexec(struct kimage *image)
 	int save_ftrace_enabled;
 
 #ifdef CONFIG_KEXEC_JUMP
-	if (kexec_image->preserve_context)
+	if (image->preserve_context)
 		save_processor_state();
 #endif
 

_______________________________________________
kexec mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/kexec