Commit 028d9b3c authored by Heiko Carstens's avatar Heiko Carstens Committed by Martin Schwidefsky

[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: default avatarHeiko Carstens <heiko.carstens@de.ibm.com>
Signed-off-by: default avatarMartin Schwidefsky <schwidefsky@de.ibm.com>
parent 39b742f9
...@@ -24,6 +24,7 @@ ...@@ -24,6 +24,7 @@
#include <linux/pagemap.h> #include <linux/pagemap.h>
#include <linux/bootmem.h> #include <linux/bootmem.h>
#include <linux/pfn.h> #include <linux/pfn.h>
#include <linux/poison.h>
#include <asm/processor.h> #include <asm/processor.h>
#include <asm/system.h> #include <asm/system.h>
...@@ -187,6 +188,7 @@ void free_initmem(void) ...@@ -187,6 +188,7 @@ void free_initmem(void)
for (; addr < (unsigned long)(&__init_end); addr += PAGE_SIZE) { for (; addr < (unsigned long)(&__init_end); addr += PAGE_SIZE) {
ClearPageReserved(virt_to_page(addr)); ClearPageReserved(virt_to_page(addr));
init_page_count(virt_to_page(addr)); init_page_count(virt_to_page(addr));
memset((void *)addr, POISON_FREE_INITMEM, PAGE_SIZE);
free_page(addr); free_page(addr);
totalram_pages++; totalram_pages++;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment