linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
From: linas@austin.ibm.com (Linas Vepstas)
To: Paul Mackerras <paulus@samba.org>
Cc: linuxppc-dev@ozlabs.org
Subject: [PATCH] powerpc: fix crash in rtas during early boot.
Date: Wed, 3 Oct 2007 13:35:43 -0500	[thread overview]
Message-ID: <20071003183543.GR4338@austin.ibm.com> (raw)


RTAS messages can occur very early during boot, before the error
message buffer has been allocated. The current code will lead to 
a null-pointer deref. Explicitly protect against this.

Signed-off-by: Linas Vepstas <linas@austin.ibm.com>
Cc: Andy Whitcroft <apw@shadowen.org>
----

Andy Whitcroft's crash was appearently due to firmware complaining
about lost power, (actually, lost power supply redundancy!), which
occurred very early during boot. 

    Type                00000040 (EPOW)
    Status:             bypassed new
    Residual error from previous boot.
    EPOW Sensor Value:  00000002
    EPOW warning due to loss of redundancy.
    EPOW general power fault.

I've no clue why firmware thought it was OK to report this 
during one of the earliest calls to RTAS; I'm still investiigating 
that.

 arch/powerpc/platforms/pseries/rtasd.c |    6 ++++++
 1 file changed, 6 insertions(+)

Index: linux-2.6.23-rc8-mm1/arch/powerpc/platforms/pseries/rtasd.c
===================================================================
--- linux-2.6.23-rc8-mm1.orig/arch/powerpc/platforms/pseries/rtasd.c	2007-09-26 15:06:49.000000000 -0500
+++ linux-2.6.23-rc8-mm1/arch/powerpc/platforms/pseries/rtasd.c	2007-10-03 11:58:09.000000000 -0500
@@ -235,6 +235,12 @@ void pSeries_log_error(char *buf, unsign
 		return;
 	}
 
+	/* During early boot, the log buffer hasn't been allocted yet. */
+	if (rtas_log_buf == NULL) {
+		spin_unlock_irqrestore(&rtasd_log_lock, s);
+		return;
+	}
+
 	/* call type specific method for error */
 	switch (err_type & ERR_TYPE_MASK) {
 	case ERR_TYPE_RTAS_LOG:

                 reply	other threads:[~2007-10-03 18:35 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20071003183543.GR4338@austin.ibm.com \
    --to=linas@austin.ibm.com \
    --cc=linuxppc-dev@ozlabs.org \
    --cc=paulus@samba.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).