[linas: [PATCH] PPC64: crash during firmware flash update]

Linas Vepstas linas at austin.ibm.com
Fri Oct 8 04:13:35 EST 2004


Sent to the wrong mailing list :)

----- Forwarded message from linas -----

To: paulus at samba.org, anton at samba.org
Cc: linuxppc64-dev at lists.linuxppc.org
Subject:  [PATCH] PPC64: crash during firmware flash update


Race conditions during system shutdown after a firmware
flash can sometimes lead to an invalid pointer deref (deref
to freed memory).  This patch fixes this.  In addition, it makes
sure that the proc entries created by the firmware flash module
are removed when the module is unloaded. 


Signed-off-by: Linas Vepstas <linas at linas.org>



--- a/arch/ppc64/kernel/rtas_flash.c.orig	2004-09-20 11:59:18.000000000 -0500
+++ b/arch/ppc64/kernel/rtas_flash.c	2004-10-06 11:19:45.000000000 -0500
@@ -562,6 +562,7 @@ static int validate_flash_release(struct

 		validate_flash(args_buf);
 	}
 
+	/* The matching atomic_inc was in rtas_excl_open() */
 	atomic_dec(&dp->count);
 
 	return 0;
@@ -572,7 +573,8 @@ static void remove_flash_pde(struct proc
 	if (dp) {
 		if (dp->data != NULL)
 			kfree(dp->data);
-		remove_proc_entry(dp->name, NULL);
+		dp->owner = NULL;
+		remove_proc_entry(dp->name, dp->parent);
 	}
 }
 


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



More information about the Linuxppc64-dev mailing list