From: Josh Poimboeuf <jpoimboe@redhat.com> To: x86@kernel.org Cc: linux-kernel@vger.kernel.org, Linus Torvalds <torvalds@linux-foundation.org>, linux-mm@kvack.org Subject: [PATCH 4/4] mm: remove kernel address exposure in free_reserved_area() Date: Tue, 25 Oct 2016 09:51:14 -0500 [thread overview] Message-ID: <6836ff90c45b71d38e5d4405aec56fa9e5d1d4b2.1477405374.git.jpoimboe@redhat.com> (raw) In-Reply-To: <cover.1477405374.git.jpoimboe@redhat.com> Linus suggested we try to remove some of the low-hanging fruit related to kernel address exposure in dmesg. The only leaks I see on my local system are: Freeing SMP alternatives memory: 32K (ffffffff9e309000 - ffffffff9e311000) Freeing initrd memory: 10588K (ffffa0b736b42000 - ffffa0b737599000) Freeing unused kernel memory: 3592K (ffffffff9df87000 - ffffffff9e309000) Freeing unused kernel memory: 1352K (ffffa0b7288ae000 - ffffa0b728a00000) Freeing unused kernel memory: 632K (ffffa0b728d62000 - ffffa0b728e00000) Linus says: "I suspect we should just remove [the addresses in the 'Freeing' messages]. I'm sure they are useful in theory, but I suspect they were more useful back when the whole "free init memory" was originally done. These days, if we have a use-after-free, I suspect the init-mem situation is the easiest situation by far. Compared to all the dynamic allocations which are much more likely to show it anyway. So having debug output for that case is likely not all that productive." With this patch the freeing messages now look like this: Freeing SMP alternatives memory: 32K Freeing initrd memory: 10588K Freeing unused kernel memory: 3592K Freeing unused kernel memory: 1352K Freeing unused kernel memory: 632K Suggested-by: Linus Torvalds <torvalds@linux-foundation.org> Cc: linux-mm@kvack.org Signed-off-by: Josh Poimboeuf <jpoimboe@redhat.com> --- mm/page_alloc.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/mm/page_alloc.c b/mm/page_alloc.c index 2b3bf67..3f63973 100644 --- a/mm/page_alloc.c +++ b/mm/page_alloc.c @@ -6508,8 +6508,8 @@ unsigned long free_reserved_area(void *start, void *end, int poison, char *s) } if (pages && s) - pr_info("Freeing %s memory: %ldK (%p - %p)\n", - s, pages << (PAGE_SHIFT - 10), start, end); + pr_info("Freeing %s memory: %ldK\n", + s, pages << (PAGE_SHIFT - 10)); return pages; } -- 2.7.4
WARNING: multiple messages have this Message-ID (diff)
From: Josh Poimboeuf <jpoimboe@redhat.com> To: x86@kernel.org Cc: linux-kernel@vger.kernel.org, Linus Torvalds <torvalds@linux-foundation.org>, linux-mm@kvack.org Subject: [PATCH 4/4] mm: remove kernel address exposure in free_reserved_area() Date: Tue, 25 Oct 2016 09:51:14 -0500 [thread overview] Message-ID: <6836ff90c45b71d38e5d4405aec56fa9e5d1d4b2.1477405374.git.jpoimboe@redhat.com> (raw) In-Reply-To: <cover.1477405374.git.jpoimboe@redhat.com> Linus suggested we try to remove some of the low-hanging fruit related to kernel address exposure in dmesg. The only leaks I see on my local system are: Freeing SMP alternatives memory: 32K (ffffffff9e309000 - ffffffff9e311000) Freeing initrd memory: 10588K (ffffa0b736b42000 - ffffa0b737599000) Freeing unused kernel memory: 3592K (ffffffff9df87000 - ffffffff9e309000) Freeing unused kernel memory: 1352K (ffffa0b7288ae000 - ffffa0b728a00000) Freeing unused kernel memory: 632K (ffffa0b728d62000 - ffffa0b728e00000) Linus says: "I suspect we should just remove [the addresses in the 'Freeing' messages]. I'm sure they are useful in theory, but I suspect they were more useful back when the whole "free init memory" was originally done. These days, if we have a use-after-free, I suspect the init-mem situation is the easiest situation by far. Compared to all the dynamic allocations which are much more likely to show it anyway. So having debug output for that case is likely not all that productive." With this patch the freeing messages now look like this: Freeing SMP alternatives memory: 32K Freeing initrd memory: 10588K Freeing unused kernel memory: 3592K Freeing unused kernel memory: 1352K Freeing unused kernel memory: 632K Suggested-by: Linus Torvalds <torvalds@linux-foundation.org> Cc: linux-mm@kvack.org Signed-off-by: Josh Poimboeuf <jpoimboe@redhat.com> --- mm/page_alloc.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/mm/page_alloc.c b/mm/page_alloc.c index 2b3bf67..3f63973 100644 --- a/mm/page_alloc.c +++ b/mm/page_alloc.c @@ -6508,8 +6508,8 @@ unsigned long free_reserved_area(void *start, void *end, int poison, char *s) } if (pages && s) - pr_info("Freeing %s memory: %ldK (%p - %p)\n", - s, pages << (PAGE_SHIFT - 10), start, end); + pr_info("Freeing %s memory: %ldK\n", + s, pages << (PAGE_SHIFT - 10)); return pages; } -- 2.7.4 -- To unsubscribe, send a message with 'unsubscribe linux-mm' in the body to majordomo@kvack.org. For more info on Linux MM, see: http://www.linux-mm.org/ . Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>
next prev parent reply other threads:[~2016-10-25 14:51 UTC|newest] Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top 2016-10-25 14:51 [PATCH 0/4] x86: fix kernel address printk exposures Josh Poimboeuf 2016-10-25 14:51 ` [PATCH 1/4] scripts/faddr2line: fix "size mismatch" error Josh Poimboeuf 2016-10-26 5:39 ` [tip:x86/asm] scripts/faddr2line: Fix " tip-bot for Josh Poimboeuf 2016-10-25 14:51 ` [PATCH 2/4] x86/dumpstack: remove kernel text addresses from stack dump Josh Poimboeuf 2016-10-26 5:40 ` [tip:x86/asm] x86/dumpstack: Remove " tip-bot for Josh Poimboeuf 2016-11-25 12:26 ` [PATCH 2/4] x86/dumpstack: remove " Kirill A. Shutemov 2016-11-28 20:49 ` Josh Poimboeuf 2016-11-28 22:27 ` Kirill A. Shutemov 2016-11-28 23:06 ` [PATCH] decode_stacktrace: fix address line detection on x86 Josh Poimboeuf 2016-11-29 7:13 ` [tip:x86/urgent] tools/decode_stacktrace.sh: Fix " tip-bot for Josh Poimboeuf 2016-11-29 13:06 ` Josh Poimboeuf 2016-11-29 13:20 ` Ingo Molnar 2016-11-29 13:24 ` [tip:x86/asm] scripts/decode_stacktrace.sh: " tip-bot for Josh Poimboeuf 2016-10-25 14:51 ` [PATCH 3/4] x86/dumpstack: remove raw stack dump Josh Poimboeuf 2016-10-26 5:40 ` [tip:x86/asm] x86/dumpstack: Remove " tip-bot for Josh Poimboeuf 2016-10-25 14:51 ` Josh Poimboeuf [this message] 2016-10-25 14:51 ` [PATCH 4/4] mm: remove kernel address exposure in free_reserved_area() Josh Poimboeuf 2016-10-26 5:41 ` [tip:x86/asm] mm/page_alloc: Remove " tip-bot for Josh Poimboeuf
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=6836ff90c45b71d38e5d4405aec56fa9e5d1d4b2.1477405374.git.jpoimboe@redhat.com \ --to=jpoimboe@redhat.com \ --cc=linux-kernel@vger.kernel.org \ --cc=linux-mm@kvack.org \ --cc=torvalds@linux-foundation.org \ --cc=x86@kernel.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: linkBe sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes, see mirroring instructions on how to clone and mirror all data and code used by this external index.