Another: [PATCH} 2.6 ppc64 rtas crash in kmalloc

Linas Vepstas linas at austin.ibm.com
Thu Jul 22 07:13:16 EST 2004


Hi,

Another bounced patch email.

--linas

----- Forwarded message from Mail Delivery System <Mailer-Daemon at bilge> -----
------ This is a copy of the message, including all the headers. ------

Return-path: <linas at bilge>
Received: from linas by bilge with local (Exim 3.36 #1 (Debian))
	id 1BkWiX-0007gc-00; Tue, 13 Jul 2004 18:29:45 -0500
Date: Tue, 13 Jul 2004 18:29:45 -0500
To: paulus at au1.ibm.com, paulus at samba.org
Cc: linuxppc64-dev at lists.linuxppc.org
Subject: [PATCH} 2.6 ppc64 rtas crash in kmalloc
Message-ID: <20040713232945.GR17333 at bilge>
Mime-Version: 1.0
Content-Type: multipart/mixed; boundary="UPT3ojh+0CqEDtpF"
Content-Disposition: inline
User-Agent: Mutt/1.5.6+20040523i
From: Linas Vepstas <linas at bilge>


--UPT3ojh+0CqEDtpF
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline




Paul,

Please review and send upstream as appropriate.

The recent set of rtas patches I sent in (about a week ago)
introduced a bug: the possible use of kmalloc before the
VM subsystem is initialized.  This patch checks for the VM
subsystem being ready, and avoids the kmalloc if its not.

People typically hit this bug during very early boot stages,
when EEH is being initialized, and an rtas_call fails, leading
to the use of kmalloc to get the error message.

--linas



--UPT3ojh+0CqEDtpF
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment; filename="rtas-kmalloc-crash.patch"

===== arch/ppc64/kernel/rtas.c 1.37 vs edited =====
--- 1.37/arch/ppc64/kernel/rtas.c	Mon Jul  5 05:27:10 2004
+++ edited/arch/ppc64/kernel/rtas.c	Tue Jul 13 18:12:06 2004
@@ -165,9 +165,13 @@

 	/* Log the error in the unlikely case that there was one. */
 	if (unlikely(logit)) {
-		buff_copy = kmalloc(RTAS_ERROR_LOG_MAX, GFP_ATOMIC);
-		if (buff_copy) {
-			memcpy(buff_copy, rtas_err_buf, RTAS_ERROR_LOG_MAX);
+		/* Can't call kmalloc if VM subsystem is not yet up. */
+		struct cache_sizes *csizep = malloc_sizes;
+		if (csizep->cs_cachep) {
+			buff_copy = kmalloc(RTAS_ERROR_LOG_MAX, GFP_ATOMIC);
+			if (buff_copy) {
+				memcpy(buff_copy, rtas_err_buf, RTAS_ERROR_LOG_MAX);
+			}
 		}
 	}


--UPT3ojh+0CqEDtpF--

----- End forwarded message -----

** Sent via the linuxppc64-dev mail list. See http://lists.linuxppc.org/





More information about the Linuxppc64-dev mailing list