From: Anton Blanchard Date: Tue, 6 Sep 2005 02:05:26 +0000 (+1000) Subject: [PATCH] ppc64: poison initmem X-Git-Tag: v2.6.14-rc1~747^2~14 X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=4721e2214b5fd6eca48caea76afb1bad3148930f;p=linux-2.6 [PATCH] ppc64: poison initmem Poison initmem after we free it so we catch use after free issues. Signed-off-by: Anton Blanchard Signed-off-by: Paul Mackerras --- diff --git a/arch/ppc64/mm/init.c b/arch/ppc64/mm/init.c index b3b1e9c177..a14ab87df4 100644 --- a/arch/ppc64/mm/init.c +++ b/arch/ppc64/mm/init.c @@ -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);