public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [S390] Poison init section before freeing it.
@ 2006-12-08 15:22 Martin Schwidefsky
  0 siblings, 0 replies; only message in thread
From: Martin Schwidefsky @ 2006-12-08 15:22 UTC (permalink / raw)
  To: linux-kernel, heiko.carstens

From: Heiko Carstens <heiko.carstens@de.ibm.com>

[S390] Poison init section before freeing it.

The data patterns should allow us to easily tell if somebody accesses
initdata/code after it was freed. Same code as on various other
architectures.

Signed-off-by: Heiko Carstens <heiko.carstens@de.ibm.com>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
---

 arch/s390/mm/init.c |    2 ++
 1 files changed, 2 insertions(+)

diff -urpN linux-2.6/arch/s390/mm/init.c linux-2.6-patched/arch/s390/mm/init.c
--- linux-2.6/arch/s390/mm/init.c	2006-12-08 15:53:05.000000000 +0100
+++ linux-2.6-patched/arch/s390/mm/init.c	2006-12-08 15:53:05.000000000 +0100
@@ -24,6 +24,7 @@
 #include <linux/pagemap.h>
 #include <linux/bootmem.h>
 #include <linux/pfn.h>
+#include <linux/poison.h>
 
 #include <asm/processor.h>
 #include <asm/system.h>
@@ -187,6 +188,7 @@ void free_initmem(void)
         for (; addr < (unsigned long)(&__init_end); addr += PAGE_SIZE) {
 		ClearPageReserved(virt_to_page(addr));
 		init_page_count(virt_to_page(addr));
+		memset((void *)addr, POISON_FREE_INITMEM, PAGE_SIZE);
 		free_page(addr);
 		totalram_pages++;
         }

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

only message in thread, other threads:[~2006-12-08 15:22 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-12-08 15:22 [S390] Poison init section before freeing it Martin Schwidefsky

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