diff options
author | Pratyush Anand <panand@redhat.com> | 2017-03-02 17:37:13 +0900 |
---|---|---|
committer | Atsushi Kumagai <ats-kumagai@wm.jp.nec.com> | 2017-03-03 13:52:45 +0900 |
commit | f1363023b909df886eca5efcb64b78be9b8e6086 (patch) | |
tree | defdc8b8f3a987b15cd156d23152a4aba8b91cd4 /arch | |
parent | 8e2834bac4f62da3894da297f083068431be6d80 (diff) |
[PATCH v3 3/7] x86_64: check physical address in PT_LOAD for none direct mapped regions
A kcore PT_LOAD can have a section from vmalloc region. However,
physical address in that header would be invalid (-1) after kernel
commit 464920104bf7 (/proc/kcore: update physical address for kcore ram
and text). Therefore, check for valid physical address while calculating
page_offset or phys_offset.
Signed-off-by: Pratyush Anand <panand@redhat.com>
Diffstat (limited to 'arch')
-rw-r--r-- | arch/x86_64.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/arch/x86_64.c b/arch/x86_64.c index 893cd51..e978a36 100644 --- a/arch/x86_64.c +++ b/arch/x86_64.c @@ -41,7 +41,8 @@ get_page_offset_x86_64(void) unsigned long long virt_start; for (i = 0; get_pt_load(i, &phys_start, NULL, &virt_start, NULL); i++) { - if (virt_start < __START_KERNEL_map) { + if (virt_start < __START_KERNEL_map + && phys_start != NOT_PADDR) { info->page_offset = virt_start - phys_start; return TRUE; } @@ -76,7 +77,8 @@ get_phys_base_x86_64(void) } for (i = 0; get_pt_load(i, &phys_start, NULL, &virt_start, NULL); i++) { - if (virt_start >= __START_KERNEL_map) { + if (virt_start >= __START_KERNEL_map + && phys_start != NOT_PADDR) { info->phys_base = phys_start - (virt_start & ~(__START_KERNEL_map)); |