mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] drivers/char/ipmi_si: prevent null deref during module exit
@ 2017-11-08 17:06 Andrew Banman
  2017-11-08 17:11 ` Andrew Banman
  0 siblings, 1 reply; 8+ messages in thread
From: Andrew Banman @ 2017-11-08 17:06 UTC (permalink / raw)
  To: Corey Minyard
  Cc: Dimitri Sivanich, Anderson, Russ, Mike Travis,
	openipmi-developer, linux-kernel

If there are uninitialized SMIs in the smi_infos list, i.e. with no
handlers set, then disable_si_irq() in cleanup_smi_one() will hit a null
pointer dereference when the former attempts to start the check enables
transaction. Thus, we panic during module exit.

Avoid panicking when there are uninitialized SMIs by checking for a handler
pointer before starting the check enables transaction.

Signed-off-by: Andrew Banman <abanman@hpe.com>
---
  drivers/char/ipmi/ipmi_si_intf.c | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/char/ipmi/ipmi_si_intf.c b/drivers/char/ipmi/ipmi_si_intf.c
index cb5719e..6c0b1b3 100644
--- a/drivers/char/ipmi/ipmi_si_intf.c
+++ b/drivers/char/ipmi/ipmi_si_intf.c
@@ -442,7 +442,7 @@ static void start_check_enables(struct smi_info *smi_info, 
bool start_timer)

  	if (start_timer)
  		start_new_msg(smi_info, msg, 2);
-	else
+	else if (smi_info->handlers)
  		smi_info->handlers->start_transaction(smi_info->si_sm, msg, 2);
  	smi_info->si_state = SI_CHECKING_ENABLES;
  }
-- 
1.8.2.1

^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2017-11-09 21:50 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-11-08 17:06 [PATCH] drivers/char/ipmi_si: prevent null deref during module exit Andrew Banman
2017-11-08 17:11 ` Andrew Banman
2017-11-08 20:00   ` Corey Minyard
2017-11-09 18:02     ` Andrew Banman
2017-11-09 18:38       ` Corey Minyard
2017-11-09 18:54         ` Corey Minyard
2017-11-09 19:48           ` [PATCH] ipmi: Prefer ACPI system interfaces over SMBIOS ones minyard
2017-11-09 21:50             ` Andrew Banman

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®