mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] PPC64: crash during firmware flash update
@ 2004-10-23  7:52 Paul Mackerras
  0 siblings, 0 replies; only message in thread
From: Paul Mackerras @ 2004-10-23  7:52 UTC (permalink / raw)
  To: akpm; +Cc: Linas Vepstas, anton, linux-kernel

This patch is from Linas Vepstas <linas@austin.ibm.com>.

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@linas.org>
Signed-off-by: Paul Mackerras <paulus@samba.org>

diff -urN linux-2.5/arch/ppc64/kernel/rtas_flash.c test/arch/ppc64/kernel/rtas_flash.c
--- linux-2.5/arch/ppc64/kernel/rtas_flash.c	2004-06-25 07:03:03.000000000 +1000
+++ test/arch/ppc64/kernel/rtas_flash.c	2004-10-23 17:38:33.445013280 +1000
@@ -562,6 +562,7 @@
 		validate_flash(args_buf);
 	}
 
+	/* The matching atomic_inc was in rtas_excl_open() */
 	atomic_dec(&dp->count);
 
 	return 0;
@@ -572,7 +573,8 @@
 	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);
 	}
 }
 

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2004-10-23  7:53 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2004-10-23  7:52 [PATCH] PPC64: crash during firmware flash update Paul Mackerras

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®