]> git.proxmox.com Git - mirror_ubuntu-disco-kernel.git/commitdiff
x86/mm/kcore: Add vsyscall page to /proc/kcore conditionally
authorJia Zhang <zhang.jia@linux.alibaba.com>
Mon, 12 Feb 2018 14:44:54 +0000 (22:44 +0800)
committerIngo Molnar <mingo@kernel.org>
Tue, 13 Feb 2018 08:15:59 +0000 (09:15 +0100)
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>
arch/x86/mm/init_64.c

index 6aa33d1e198f260c1231899d2c683cf78543c3c5..8ba9c3128947337bdb26d543dd56d7b0b126b310 100644 (file)
@@ -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);
 }