From: Anton Blanchard Date: Tue, 6 Sep 2005 02:05:26 +0000 (+1000) Subject: [PATCH] ppc64: poison initmem X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=4721e2214b5fd6eca48caea76afb1bad3148930f;p=GitHub%2FLineageOS%2Fandroid_kernel_motorola_exynos9610.git [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 b3b1e9c1770a..a14ab87df491 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);