[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <tip-cd026ca2861e7f384d677626a483da797c76b9da@git.kernel.org>
Date: Tue, 13 Feb 2018 01:08:09 -0800
From: tip-bot for Jia Zhang <tipbot@...or.com>
To: linux-tip-commits@...r.kernel.org
Cc: jolsa@...nel.org, mingo@...nel.org, hpa@...or.com,
zhang.jia@...ux.alibaba.com, peterz@...radead.org,
tglx@...utronix.de, viro@...iv.linux.org.uk,
linux-kernel@...r.kernel.org, torvalds@...ux-foundation.org
Subject: [tip:x86/urgent] x86/mm/kcore: Add vsyscall page to /proc/kcore
conditionally
Commit-ID: cd026ca2861e7f384d677626a483da797c76b9da
Gitweb: https://git.kernel.org/tip/cd026ca2861e7f384d677626a483da797c76b9da
Author: Jia Zhang <zhang.jia@...ux.alibaba.com>
AuthorDate: Mon, 12 Feb 2018 22:44:54 +0800
Committer: Ingo Molnar <mingo@...nel.org>
CommitDate: Tue, 13 Feb 2018 09:15:59 +0100
x86/mm/kcore: Add vsyscall page to /proc/kcore conditionally
The vsyscall page should be visible only if vsyscall=emulate/native when dumping /proc/kcore.
Signed-off-by: Jia Zhang <zhang.jia@...ux.alibaba.com>
Reviewed-by: Jiri Olsa <jolsa@...nel.org>
Cc: Al Viro <viro@...iv.linux.org.uk>
Cc: Linus Torvalds <torvalds@...ux-foundation.org>
Cc: Peter Zijlstra <peterz@...radead.org>
Cc: Thomas Gleixner <tglx@...utronix.de>
Cc: jolsa@...hat.com
Link: http://lkml.kernel.org/r/1518446694-21124-3-git-send-email-zhang.jia@linux.alibaba.com
Signed-off-by: Ingo Molnar <mingo@...nel.org>
---
arch/x86/mm/init_64.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/arch/x86/mm/init_64.c b/arch/x86/mm/init_64.c
index 6aa33d1..8ba9c31 100644
--- a/arch/x86/mm/init_64.c
+++ b/arch/x86/mm/init_64.c
@@ -1193,7 +1193,8 @@ void __init mem_init(void)
register_page_bootmem_info();
/* Register memory areas for /proc/kcore */
- kclist_add(&kcore_vsyscall, (void *)VSYSCALL_ADDR, PAGE_SIZE, KCORE_USER);
+ if (get_gate_vma(&init_mm))
+ kclist_add(&kcore_vsyscall, (void *)VSYSCALL_ADDR, PAGE_SIZE, KCORE_USER);
mem_init_print_info(NULL);
}
Powered by blists - more mailing lists