Skip to content

Commit cd026ca

Browse files
jiazhang0Ingo Molnar
authored andcommitted
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 <[email protected]> Reviewed-by: Jiri Olsa <[email protected]> Cc: Al Viro <[email protected]> Cc: Linus Torvalds <[email protected]> Cc: Peter Zijlstra <[email protected]> Cc: Thomas Gleixner <[email protected]> Cc: [email protected] Link: http://lkml.kernel.org/r/[email protected] Signed-off-by: Ingo Molnar <[email protected]>
1 parent 595dd46 commit cd026ca

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

arch/x86/mm/init_64.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1193,7 +1193,8 @@ void __init mem_init(void)
11931193
register_page_bootmem_info();
11941194

11951195
/* 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);
11971198

11981199
mem_init_print_info(NULL);
11991200
}

0 commit comments

Comments
 (0)