aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJia Zhang <zhang.jia@linux.alibaba.com>2018-02-12 09:44:54 -0500
committerIngo Molnar <mingo@kernel.org>2018-02-13 03:15:59 -0500
commitcd026ca2861e7f384d677626a483da797c76b9da (patch)
tree5e6fccb5526b952ff08bb2718b2c50f952ee8474
parent595dd46ebfc10be041a365d0a3fa99df50b6ba73 (diff)
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@linux.alibaba.com> Reviewed-by: Jiri Olsa <jolsa@kernel.org> Cc: Al Viro <viro@zeniv.linux.org.uk> Cc: Linus Torvalds <torvalds@linux-foundation.org> Cc: Peter Zijlstra <peterz@infradead.org> Cc: Thomas Gleixner <tglx@linutronix.de> Cc: jolsa@redhat.com Link: http://lkml.kernel.org/r/1518446694-21124-3-git-send-email-zhang.jia@linux.alibaba.com Signed-off-by: Ingo Molnar <mingo@kernel.org>
-rw-r--r--arch/x86/mm/init_64.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/arch/x86/mm/init_64.c b/arch/x86/mm/init_64.c
index 6aa33d1e198f..8ba9c3128947 100644
--- a/arch/x86/mm/init_64.c
+++ b/arch/x86/mm/init_64.c
@@ -1193,7 +1193,8 @@ void __init mem_init(void)
1193 register_page_bootmem_info(); 1193 register_page_bootmem_info();
1194 1194
1195 /* Register memory areas for /proc/kcore */ 1195 /* Register memory areas for /proc/kcore */
1196 kclist_add(&kcore_vsyscall, (void *)VSYSCALL_ADDR, PAGE_SIZE, KCORE_USER); 1196 if (get_gate_vma(&init_mm))
1197 kclist_add(&kcore_vsyscall, (void *)VSYSCALL_ADDR, PAGE_SIZE, KCORE_USER);
1197 1198
1198 mem_init_print_info(NULL); 1199 mem_init_print_info(NULL);
1199} 1200}