diff options
author | Mike Rapoport <rppt@linux.ibm.com> | 2019-05-13 20:18:46 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2019-05-14 12:47:47 -0400 |
commit | f40399992a245c852ad446e265d1567010db5e10 (patch) | |
tree | 840728fb509eed29dd784e96de1d9e5c2e86ecc1 | |
parent | 522c99194549e50a9bd76427a06922d7a68237d6 (diff) |
init: free_initmem: poison freed init memory
Various architectures including x86 poison the freed init memory. Do the
same in the generic free_initmem implementation and switch sparc32
architecture that is identical to the generic code over to it now.
Link: http://lkml.kernel.org/r/1550515285-17446-4-git-send-email-rppt@linux.ibm.com
Signed-off-by: Mike Rapoport <rppt@linux.ibm.com>
Reviewed-by: Andrew Morton <akpm@linux-foundation.org>
Cc: Christoph Hellwig <hch@lst.de>
Cc: Palmer Dabbelt <palmer@sifive.com>
Cc: Richard Kuo <rkuo@codeaurora.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
-rw-r--r-- | arch/sparc/mm/init_32.c | 5 | ||||
-rw-r--r-- | init/main.c | 2 |
2 files changed, 1 insertions, 6 deletions
diff --git a/arch/sparc/mm/init_32.c b/arch/sparc/mm/init_32.c index 417f89d5e0b2..046ab116cc8c 100644 --- a/arch/sparc/mm/init_32.c +++ b/arch/sparc/mm/init_32.c | |||
@@ -294,11 +294,6 @@ void __init mem_init(void) | |||
294 | mem_init_print_info(NULL); | 294 | mem_init_print_info(NULL); |
295 | } | 295 | } |
296 | 296 | ||
297 | void free_initmem (void) | ||
298 | { | ||
299 | free_initmem_default(POISON_FREE_INITMEM); | ||
300 | } | ||
301 | |||
302 | void sparc_flush_page_to_ram(struct page *page) | 297 | void sparc_flush_page_to_ram(struct page *page) |
303 | { | 298 | { |
304 | unsigned long vaddr = (unsigned long)page_address(page); | 299 | unsigned long vaddr = (unsigned long)page_address(page); |
diff --git a/init/main.c b/init/main.c index 26234570a324..5a2c69b4d7b3 100644 --- a/init/main.c +++ b/init/main.c | |||
@@ -1076,7 +1076,7 @@ static inline void mark_readonly(void) | |||
1076 | 1076 | ||
1077 | void __weak free_initmem(void) | 1077 | void __weak free_initmem(void) |
1078 | { | 1078 | { |
1079 | free_initmem_default(-1); | 1079 | free_initmem_default(POISON_FREE_INITMEM); |
1080 | } | 1080 | } |
1081 | 1081 | ||
1082 | static int __ref kernel_init(void *unused) | 1082 | static int __ref kernel_init(void *unused) |