All of lore.kernel.org
 help / color / mirror / Atom feed
From: Pratyush Anand <panand@redhat.com>
To: ats-kumagai@wm.jp.nec.com
Cc: Pratyush Anand <panand@redhat.com>,
	dyoung@redhat.com, kexec@lists.infradead.org, bhe@redhat.com
Subject: [Makedumpfile Patch v3 4/7] elf_info: kcore: check for invalid physical address
Date: Thu,  2 Mar 2017 14:06:49 +0530	[thread overview]
Message-ID: <5647c5e3caa1e469b625f4adb7277493e9795fb3.1488443170.git.panand@redhat.com> (raw)
In-Reply-To: <cover.1488443170.git.panand@redhat.com>
In-Reply-To: <cover.1488443170.git.panand@redhat.com>

kcore passes correct phys_start for direct mapped region and an invalid
value (-1) for all other regions after the kernel commit
464920104bf7(/proc/kcore: update physical address for kcore ram and
text). arch specific function is_phys_addr() accepts only virt_start.
Therefore, check for valid phys_start in get_kcore_dump_loads().

Signed-off-by: Pratyush Anand <panand@redhat.com>
---
 elf_info.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/elf_info.c b/elf_info.c
index 65ff333cf33a..c5743b3cab28 100644
--- a/elf_info.c
+++ b/elf_info.c
@@ -881,7 +881,8 @@ int get_kcore_dump_loads(void)
 
 	for (i = 0; i < num_pt_loads; ++i) {
 		struct pt_load_segment *p = &pt_loads[i];
-		if (!is_phys_addr(p->virt_start))
+		if (p->phys_start == NOT_PADDR
+				|| !is_phys_addr(p->virt_start))
 			continue;
 		loads++;
 	}
@@ -901,7 +902,8 @@ int get_kcore_dump_loads(void)
 
 	for (i = 0, j = 0; i < num_pt_loads; ++i) {
 		struct pt_load_segment *p = &pt_loads[i];
-		if (!is_phys_addr(p->virt_start))
+		if (p->phys_start == NOT_PADDR
+				|| !is_phys_addr(p->virt_start))
 			continue;
 		if (j >= loads)
 			return FALSE;
-- 
2.9.3


_______________________________________________
kexec mailing list
kexec@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/kexec

  parent reply	other threads:[~2017-03-02  8:37 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-03-02  8:36 [Makedumpfile Patch v3 0/7] Fix --mem-usage /proc/kcore Pratyush Anand
2017-03-02  8:36 ` [Makedumpfile Patch v3 1/7] show_mem_usage(): calculate page offset after elf load Pratyush Anand
2017-03-02  8:36 ` [Makedumpfile Patch v3 2/7] initial(): call cach_init() a bit early Pratyush Anand
2017-07-19  7:46   ` Atsushi Kumagai
2017-07-19 11:20     ` Pratyush Anand
2017-07-20  6:54       ` Atsushi Kumagai
2017-07-20  8:01         ` Hatayama, Daisuke
2017-03-02  8:36 ` [Makedumpfile Patch v3 3/7] x86_64: check physical address in PT_LOAD for none direct mapped regions Pratyush Anand
2017-03-02  8:36 ` Pratyush Anand [this message]
2017-03-02  8:36 ` [Makedumpfile Patch v3 5/7] makedumpfile: Correct the calculation of kvaddr in set_kcore_vmcoreinfo Pratyush Anand
2017-03-02  8:36 ` [Makedumpfile Patch v3 6/7] makedumpfile: Discard process_dump_load Pratyush Anand
2017-03-02  8:36 ` [Makedumpfile Patch v3 7/7] mem-usage: allow to work only with -f for kernel version < 4.11 Pratyush Anand
2017-03-03  2:10   ` Atsushi Kumagai
2017-03-03  2:48     ` Pratyush Anand
2017-03-03  3:07       ` bhe
2017-03-03  4:35         ` Atsushi Kumagai
2017-03-03  4:56           ` Pratyush Anand

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=5647c5e3caa1e469b625f4adb7277493e9795fb3.1488443170.git.panand@redhat.com \
    --to=panand@redhat.com \
    --cc=ats-kumagai@wm.jp.nec.com \
    --cc=bhe@redhat.com \
    --cc=dyoung@redhat.com \
    --cc=kexec@lists.infradead.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.