[PATCH] ppc64: poison initmem
authorAnton Blanchard <anton@samba.org>
Tue, 6 Sep 2005 02:05:26 +0000 (12:05 +1000)
committerPaul Mackerras <paulus@samba.org>
Tue, 6 Sep 2005 06:07:53 +0000 (16:07 +1000)
Poison initmem after we free it so we catch use after free issues.

Signed-off-by: Anton Blanchard <anton@samba.org>
Signed-off-by: Paul Mackerras <paulus@samba.org>
arch/ppc64/mm/init.c

index b3b1e9c..a14ab87 100644 (file)
@@ -392,6 +392,7 @@ void free_initmem(void)
 
        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);