Skip to contentSkip to conversation

IPMI panic

DISCUSSION Paolo Galtieri 2 participants 2 messages Dec 14, 2005

lore
Share & tools
lore
#0 lore raw

Oops,
brain fade - forgot the Signed-of-by. Resent as requested
by Corey Minyard.

Folks,
while doing some testing I discovered that if the BIOS on a
board does not properly setup the DMI information it leads to a panic in the IPMI code. The panic is due to dereferencing a pointer which is not initialized. The pointer is initialized in port_setup() and/or mem_setup() and used in init_one_smi() and cleanup_one_si(), however if either port_setup() or mem_setup() return ENODEV the pointer does not get initialized. The patch is below done against 2.6.15-rc5-git4

Paolo

--- linux-2.6.15-rc5/drivers/char/ipmi/ipmi_si_intf.c 2005-12-05
10:02:56.000000000 -0700
+++ new-linux-2.6.15-rc5/drivers/char/ipmi/ipmi_si_intf.c 2005-12-14
13:57:02.000000000 -0700
@@ -2399,7 +2399,8 @@
new_smi->handlers->cleanup(new_smi->si_sm);
kfree(new_smi->si_sm);
}
- new_smi->io_cleanup(new_smi);
+ if (new_smi->io_cleanup)
+ new_smi->io_cleanup(new_smi);

return rv;
}
@@ -2518,7 +2519,8 @@

kfree(to_clean->si_sm);

- to_clean->io_cleanup(to_clean);
+ if (to_clean->io_cleanup)
+ to_clean->io_cleanup(to_clean);
}

static __exit void cleanup_ipmi_si(void)

#1 lore raw

Yes, there is an error patch that can get here with those values set to NULL.

Thanks, Paolo.

-Corey

Quoted 46 lines · Paolo Galtieri

Oops,
brain fade - forgot the Signed-of-by. Resent as requested
by Corey Minyard.

Folks,
while doing some testing I discovered that if the BIOS on a
board does not properly setup the DMI information it leads to a panic in the IPMI code. The panic is due to dereferencing a pointer which is not initialized. The pointer is initialized in port_setup() and/or mem_setup() and used in init_one_smi() and cleanup_one_si(), however if either port_setup() or mem_setup() return ENODEV the pointer does not get initialized. The patch is below done against 2.6.15-rc5-git4

Paolo

--- linux-2.6.15-rc5/drivers/char/ipmi/ipmi_si_intf.c 2005-12-05
10:02:56.000000000 -0700
+++ new-linux-2.6.15-rc5/drivers/char/ipmi/ipmi_si_intf.c 2005-12-14
13:57:02.000000000 -0700

(quoted diff) +4 -2
@@ -2399,7 +2399,8 @@
 			new_smi->handlers->cleanup(new_smi->si_sm);
 		kfree(new_smi->si_sm);
 	}
-	new_smi->io_cleanup(new_smi);
+	if (new_smi->io_cleanup)
+		new_smi->io_cleanup(new_smi);
 
 	return rv;
 }
@@ -2518,7 +2519,8 @@
 
 	kfree(to_clean->si_sm);
 
-	to_clean->io_cleanup(to_clean);
+	if (to_clean->io_cleanup)
+		to_clean->io_cleanup(to_clean);
 }
 
 static __exit void cleanup_ipmi_si(void)