diff options
author | Thomas Garnier <thgarnie@google.com> | 2016-10-11 16:55:08 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2016-10-11 18:06:33 -0400 |
commit | 0549a3c02efb350776bc869685a361045efd3a29 (patch) | |
tree | 5ee321acb84f3e8c625927d2204853bbdc441c56 | |
parent | 2a1613a586de91457fa93c3e468a6e2438fe52a0 (diff) |
kdump, vmcoreinfo: report memory sections virtual addresses
KASLR memory randomization can randomize the base of the physical memory
mapping (PAGE_OFFSET), vmalloc (VMALLOC_START) and vmemmap
(VMEMMAP_START). Adding these variables on VMCOREINFO so tools can easily
identify the base of each memory section.
Link: http://lkml.kernel.org/r/1471531632-23003-1-git-send-email-thgarnie@google.com
Signed-off-by: Thomas Garnier <thgarnie@google.com>
Acked-by: Baoquan He <bhe@redhat.com>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: Ingo Molnar <mingo@redhat.com>
Cc: "H . Peter Anvin" <hpa@zytor.com>
Cc: Eric Biederman <ebiederm@xmission.com>
Cc: Xunlei Pang <xlpang@redhat.com>
Cc: HATAYAMA Daisuke <d.hatayama@jp.fujitsu.com>
Cc: Kees Cook <keescook@chromium.org>
Cc: Eugene Surovegin <surovegin@google.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
-rw-r--r-- | arch/x86/kernel/machine_kexec_64.c | 3 | ||||
-rw-r--r-- | include/linux/kexec.h | 6 |
2 files changed, 9 insertions, 0 deletions
diff --git a/arch/x86/kernel/machine_kexec_64.c b/arch/x86/kernel/machine_kexec_64.c index 5a294e48b185..8c1f218926d7 100644 --- a/arch/x86/kernel/machine_kexec_64.c +++ b/arch/x86/kernel/machine_kexec_64.c | |||
@@ -337,6 +337,9 @@ void arch_crash_save_vmcoreinfo(void) | |||
337 | #endif | 337 | #endif |
338 | vmcoreinfo_append_str("KERNELOFFSET=%lx\n", | 338 | vmcoreinfo_append_str("KERNELOFFSET=%lx\n", |
339 | kaslr_offset()); | 339 | kaslr_offset()); |
340 | VMCOREINFO_PAGE_OFFSET(PAGE_OFFSET); | ||
341 | VMCOREINFO_VMALLOC_START(VMALLOC_START); | ||
342 | VMCOREINFO_VMEMMAP_START(VMEMMAP_START); | ||
340 | } | 343 | } |
341 | 344 | ||
342 | /* arch-dependent functionality related to kexec file-based syscall */ | 345 | /* arch-dependent functionality related to kexec file-based syscall */ |
diff --git a/include/linux/kexec.h b/include/linux/kexec.h index d7437777baaa..406c33dcae13 100644 --- a/include/linux/kexec.h +++ b/include/linux/kexec.h | |||
@@ -259,6 +259,12 @@ phys_addr_t paddr_vmcoreinfo_note(void); | |||
259 | vmcoreinfo_append_str("NUMBER(%s)=%ld\n", #name, (long)name) | 259 | vmcoreinfo_append_str("NUMBER(%s)=%ld\n", #name, (long)name) |
260 | #define VMCOREINFO_CONFIG(name) \ | 260 | #define VMCOREINFO_CONFIG(name) \ |
261 | vmcoreinfo_append_str("CONFIG_%s=y\n", #name) | 261 | vmcoreinfo_append_str("CONFIG_%s=y\n", #name) |
262 | #define VMCOREINFO_PAGE_OFFSET(value) \ | ||
263 | vmcoreinfo_append_str("PAGE_OFFSET=%lx\n", (unsigned long)value) | ||
264 | #define VMCOREINFO_VMALLOC_START(value) \ | ||
265 | vmcoreinfo_append_str("VMALLOC_START=%lx\n", (unsigned long)value) | ||
266 | #define VMCOREINFO_VMEMMAP_START(value) \ | ||
267 | vmcoreinfo_append_str("VMEMMAP_START=%lx\n", (unsigned long)value) | ||
262 | 268 | ||
263 | extern struct kimage *kexec_image; | 269 | extern struct kimage *kexec_image; |
264 | extern struct kimage *kexec_crash_image; | 270 | extern struct kimage *kexec_crash_image; |