[PATCH] ppc64: poison initmem

Anton Blanchard anton at samba.org
Tue Sep 6 12:05:26 EST 2005


Poison initmem after we free it so we catch use after free issues.

Signed-off-by: Anton Blanchard <anton at samba.org>

Index: build/arch/ppc64/mm/init.c
===================================================================
--- build.orig/arch/ppc64/mm/init.c	2005-09-06 11:29:15.000000000 +1000
+++ build/arch/ppc64/mm/init.c	2005-09-06 11:29:36.000000000 +1000
@@ -392,6 +392,7 @@
 
 	addr = (unsigned long)__init_begin;
 	for (; addr < (unsigned long)__init_end; addr += PAGE_SIZE) {
+		memset((void *)addr, 0xcc, PAGE_SIZE);
 		ClearPageReserved(virt_to_page(addr));
 		set_page_count(virt_to_page(addr), 1);
 		free_page(addr);



More information about the Linuxppc64-dev mailing list