From: Mike Rapoport <rppt@linux.ibm.com>
To: Andrew Morton <akpm@linux-foundation.org>
Cc: Christoph Hellwig <hch@lst.de>,
Palmer Dabbelt <palmer@sifive.com>,
Richard Kuo <rkuo@codeaurora.org>,
linux-arch@vger.kernel.org, linux-hexagon@vger.kernel.org,
linux-kernel@vger.kernel.org, linux-mm@kvack.org,
linux-riscv@lists.infradead.org,
Mike Rapoport <rppt@linux.ibm.com>
Subject: [PATCH v2 3/4] init: free_initmem: poison freed init memory
Date: Mon, 18 Feb 2019 20:41:24 +0200 [thread overview]
Message-ID: <1550515285-17446-4-git-send-email-rppt@linux.ibm.com> (raw)
In-Reply-To: <1550515285-17446-1-git-send-email-rppt@linux.ibm.com>
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.
Signed-off-by: Mike Rapoport <rppt@linux.ibm.com>
---
arch/sparc/mm/init_32.c | 5 -----
init/main.c | 2 +-
2 files changed, 1 insertion(+), 6 deletions(-)
diff --git a/arch/sparc/mm/init_32.c b/arch/sparc/mm/init_32.c
index f0dbc0b..d02a9ae 100644
--- a/arch/sparc/mm/init_32.c
+++ b/arch/sparc/mm/init_32.c
@@ -294,11 +294,6 @@ void __init mem_init(void)
mem_init_print_info(NULL);
}
-void free_initmem (void)
-{
- free_initmem_default(POISON_FREE_INITMEM);
-}
-
void sparc_flush_page_to_ram(struct page *page)
{
unsigned long vaddr = (unsigned long)page_address(page);
diff --git a/init/main.c b/init/main.c
index 38d69e0..9a61e9c 100644
--- a/init/main.c
+++ b/init/main.c
@@ -1049,7 +1049,7 @@ static inline void mark_readonly(void)
void __weak free_initmem(void)
{
- free_initmem_default(-1);
+ free_initmem_default(POISON_FREE_INITMEM);
}
static int __ref kernel_init(void *unused)
--
2.7.4
next prev parent reply other threads:[~2019-02-18 18:44 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-02-18 18:41 [PATCH v2 0/4] provide a generic free_initmem implementation Mike Rapoport
2019-02-18 18:41 ` [PATCH v2 1/4] init: " Mike Rapoport
2019-02-18 18:41 ` [PATCH v2 2/4] hexagon: switch over to generic free_initmem() Mike Rapoport
2019-02-18 18:41 ` Mike Rapoport [this message]
2019-02-18 18:41 ` [PATCH v2 4/4] riscv: " Mike Rapoport
2019-03-25 7:20 ` [PATCH v2 0/4] provide a generic free_initmem implementation Mike Rapoport
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1550515285-17446-4-git-send-email-rppt@linux.ibm.com \
--to=rppt@linux.ibm.com \
--cc=akpm@linux-foundation.org \
--cc=hch@lst.de \
--cc=linux-arch@vger.kernel.org \
--cc=linux-hexagon@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=linux-riscv@lists.infradead.org \
--cc=palmer@sifive.com \
--cc=rkuo@codeaurora.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).