Gitweb:     
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=c2c77fe8df3e0322a613ba1540910632ad14d96d
Commit:     c2c77fe8df3e0322a613ba1540910632ad14d96d
Parent:     87f76d3aafe5b5e0a1d6d857088a0263b35afa6b
Author:     Bernhard Walle <[EMAIL PROTECTED]>
AuthorDate: Sun Jan 28 13:47:02 2007 +0100
Committer:  Tony Luck <[EMAIL PROTECTED]>
CommitDate: Mon Feb 5 14:06:44 2007 -0800

    [IA64] Fix NULL-pointer dereference in ia64_machine_kexec()
    
    This patch fixes a NULL-pointer dereference in ia64_machine_kexec().
    
    The variable ia64_kimage is set in machine_kexec_prepare() which is
    called from sys_kexec_load(). If kdump wasn't configured before,
    ia64_kimage is NULL.  machine_kdump_on_init() passes ia64_kimage() to
    machine_kexec() which assumes a valid value.
    
    The patch also adds a few sanity checks for the image to simplify
    debugging of similar problems in future.
    
    Signed-off-by: Bernhard Walle <[EMAIL PROTECTED]>
    Signed-off-by: Tony Luck <[EMAIL PROTECTED]>
---
 arch/ia64/kernel/crash.c         |    5 +++++
 arch/ia64/kernel/machine_kexec.c |    2 ++
 2 files changed, 7 insertions(+), 0 deletions(-)

diff --git a/arch/ia64/kernel/crash.c b/arch/ia64/kernel/crash.c
index 2018e62..9d92097 100644
--- a/arch/ia64/kernel/crash.c
+++ b/arch/ia64/kernel/crash.c
@@ -118,6 +118,11 @@ machine_crash_shutdown(struct pt_regs *pt)
 static void
 machine_kdump_on_init(void)
 {
+       if (!ia64_kimage) {
+               printk(KERN_NOTICE "machine_kdump_on_init(): "
+                               "kdump not configured\n");
+               return;
+       }
        local_irq_disable();
        kexec_disable_iosapic();
        machine_kexec(ia64_kimage);
diff --git a/arch/ia64/kernel/machine_kexec.c b/arch/ia64/kernel/machine_kexec.c
index e51cd90..4f0f3b8 100644
--- a/arch/ia64/kernel/machine_kexec.c
+++ b/arch/ia64/kernel/machine_kexec.c
@@ -82,6 +82,7 @@ static void ia64_machine_kexec(struct unw_frame_info *info, 
void *arg)
        unsigned long vector;
        int ii;
 
+       BUG_ON(!image);
        if (image->type == KEXEC_TYPE_CRASH) {
                crash_save_this_cpu();
                current->thread.ksp = (__u64)info->sw - 16;
@@ -120,6 +121,7 @@ static void ia64_machine_kexec(struct unw_frame_info *info, 
void *arg)
 
 void machine_kexec(struct kimage *image)
 {
+       BUG_ON(!image);
        unw_init_running(ia64_machine_kexec, image);
        for(;;);
 }
-
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to