diff options
author | Heiko Carstens <heiko.carstens@de.ibm.com> | 2006-12-08 09:56:13 -0500 |
---|---|---|
committer | Martin Schwidefsky <schwidefsky@de.ibm.com> | 2006-12-08 09:56:13 -0500 |
commit | 028d9b3cc62cb9dd31f1b5929edb3c23612cfccc (patch) | |
tree | ab09aa1722b53ffb1c890a6c59ebf047d2997501 | |
parent | 39b742f957a287a7514a8a35c9f516cdf30b9ff5 (diff) |
[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: Heiko Carstens <heiko.carstens@de.ibm.com>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
-rw-r--r-- | arch/s390/mm/init.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/arch/s390/mm/init.c b/arch/s390/mm/init.c index aa39591ca130..4bb21be3b007 100644 --- a/arch/s390/mm/init.c +++ b/arch/s390/mm/init.c | |||
@@ -24,6 +24,7 @@ | |||
24 | #include <linux/pagemap.h> | 24 | #include <linux/pagemap.h> |
25 | #include <linux/bootmem.h> | 25 | #include <linux/bootmem.h> |
26 | #include <linux/pfn.h> | 26 | #include <linux/pfn.h> |
27 | #include <linux/poison.h> | ||
27 | 28 | ||
28 | #include <asm/processor.h> | 29 | #include <asm/processor.h> |
29 | #include <asm/system.h> | 30 | #include <asm/system.h> |
@@ -187,6 +188,7 @@ void free_initmem(void) | |||
187 | for (; addr < (unsigned long)(&__init_end); addr += PAGE_SIZE) { | 188 | for (; addr < (unsigned long)(&__init_end); addr += PAGE_SIZE) { |
188 | ClearPageReserved(virt_to_page(addr)); | 189 | ClearPageReserved(virt_to_page(addr)); |
189 | init_page_count(virt_to_page(addr)); | 190 | init_page_count(virt_to_page(addr)); |
191 | memset((void *)addr, POISON_FREE_INITMEM, PAGE_SIZE); | ||
190 | free_page(addr); | 192 | free_page(addr); |
191 | totalram_pages++; | 193 | totalram_pages++; |
192 | } | 194 | } |