Kexec Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Pratyush Anand <panand@redhat.com>
To: Dave Young <dyoung@redhat.com>
Cc: kexec@lists.infradead.org, anderson@redhat.com,
	linux-kernel@vger.kernel.org, bhe@redhat.com
Subject: Re: [PATCH] /proc/kcore: Update physical address for kcore ram and text
Date: Wed, 25 Jan 2017 12:21:47 +0530	[thread overview]
Message-ID: <c99e8165-1aa7-4bb3-ef6f-7d66020c57dd@redhat.com> (raw)
In-Reply-To: <20170125062949.GA3423@dhcp-128-65.nay.redhat.com>

Hi Dave,

On Wednesday 25 January 2017 11:59 AM, Dave Young wrote:
> Hi Pratyush
> On 01/25/17 at 10:14am, Pratyush Anand wrote:
>> Currently all the p_paddr of PT_LOAD headers are assigned to 0, which is
>> not true and could be misleading, since 0 is a valid physical address.
> I do not know the history of /proc/kcore, so a question is why the
> p_addr was set as 0, if there were some reasons and if this could cause
> some risk or breakage.
>

I do not know why it was 0, which is a valid physical address. But 
certainly, it might break some user space tools, and those need to be 
fixed. For example, see following code from kexec-tools

kexec/kexec-elf.c:build_mem_phdrs()

435                 if ((phdr->p_paddr + phdr->p_memsz) < phdr->p_paddr) {
436                         /* The memory address wraps */
437                         if (probe_debug) {
438                                 fprintf(stderr, "ELF address wrap 
around\n");
439                         }
440                         return -1;
441                 }

We do not need to perform above check for an invalid physical address.

I think, kexec-tools and makedumpfile will need fixup. I already have 
those fixup which will be sent upstream once this patch makes through.
Pro with this approach is that, it will help to calculate variable like 
page_offset, phys_base from PT_LOAD even when they are randomized and 
therefore will reduce many variable and version specific values in user 
space tools.

~Pratyush

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

  reply	other threads:[~2017-01-25  6:52 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-01-25  4:44 [PATCH] /proc/kcore: Update physical address for kcore ram and text Pratyush Anand
2017-01-25  6:29 ` Dave Young
2017-01-25  6:51   ` Pratyush Anand [this message]
     [not found] ` <CAHB_GupwpXiZjmy+4SQLvoJaJkAo9VvNVxQgxqvXeACRR--exg@mail.gmail.com>
2017-02-13 22:25   ` Kees Cook
2017-02-14  1:46     ` Pratyush Anand
2017-02-24  7:20       ` Pratyush Anand
2017-02-24  7:39     ` Baoquan He

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=c99e8165-1aa7-4bb3-ef6f-7d66020c57dd@redhat.com \
    --to=panand@redhat.com \
    --cc=anderson@redhat.com \
    --cc=bhe@redhat.com \
    --cc=dyoung@redhat.com \
    --cc=kexec@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox