From mboxrd@z Thu Jan 1 00:00:00 1970 Return-path: Received: from mail-qk0-f179.google.com ([209.85.220.179]) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1bA6PL-0003Ok-0y for kexec@lists.infradead.org; Tue, 07 Jun 2016 02:06:19 +0000 Received: by mail-qk0-f179.google.com with SMTP id i187so88266461qkd.3 for ; Mon, 06 Jun 2016 19:05:56 -0700 (PDT) Date: Tue, 7 Jun 2016 07:35:50 +0530 From: Pratyush Anand Subject: Re: [PATCH kexec-tools v2 04/32] kdump: fix kdump mapping Message-ID: <20160607020550.GA9722@dhcppc6> References: <20160606164129.GM1041@n2100.armlinux.org.uk> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "kexec" Errors-To: kexec-bounces+dwmw2=infradead.org@lists.infradead.org To: Russell King Cc: kexec@lists.infradead.org, Baoquan He , linux-arm-kernel@lists.infradead.org On 06/06/2016:05:59:03 PM, Russell King wrote: > When kdump tries to map the program header, it fails to take account > of ehdr->e_phoff being an offset from the start of the ELF "file", > which causes: > > Cannot mmap /dev/mem offset: 64 size: 392: Invalid argument > > Ensure that we take account of the start address when mapping this. > > This fix has been extracted from a larger patch by Vitaly Andrianov > adding support for Keystone 2. > > Signed-off-by: Russell King Reviewed-by: Pratyush Anand > --- > kdump/kdump.c | 3 ++- > 1 file changed, 2 insertions(+), 1 deletion(-) > > diff --git a/kdump/kdump.c b/kdump/kdump.c > index 1f5b984..34d2149 100644 > --- a/kdump/kdump.c > +++ b/kdump/kdump.c > @@ -284,7 +284,8 @@ int main(int argc, char **argv) > } > > /* Get the program header */ > - phdr = map_addr(fd, sizeof(*phdr)*(ehdr->e_phnum), ehdr->e_phoff); > + phdr = map_addr(fd, sizeof(*phdr)*(ehdr->e_phnum), > + start_addr + ehdr->e_phoff); > > /* Collect up the notes */ > note_bytes = 0; > -- > 1.9.1 _______________________________________________ kexec mailing list kexec@lists.infradead.org http://lists.infradead.org/mailman/listinfo/kexec From mboxrd@z Thu Jan 1 00:00:00 1970 From: panand@redhat.com (Pratyush Anand) Date: Tue, 7 Jun 2016 07:35:50 +0530 Subject: [PATCH kexec-tools v2 04/32] kdump: fix kdump mapping In-Reply-To: References: <20160606164129.GM1041@n2100.armlinux.org.uk> Message-ID: <20160607020550.GA9722@dhcppc6> To: linux-arm-kernel@lists.infradead.org List-Id: linux-arm-kernel.lists.infradead.org On 06/06/2016:05:59:03 PM, Russell King wrote: > When kdump tries to map the program header, it fails to take account > of ehdr->e_phoff being an offset from the start of the ELF "file", > which causes: > > Cannot mmap /dev/mem offset: 64 size: 392: Invalid argument > > Ensure that we take account of the start address when mapping this. > > This fix has been extracted from a larger patch by Vitaly Andrianov > adding support for Keystone 2. > > Signed-off-by: Russell King Reviewed-by: Pratyush Anand > --- > kdump/kdump.c | 3 ++- > 1 file changed, 2 insertions(+), 1 deletion(-) > > diff --git a/kdump/kdump.c b/kdump/kdump.c > index 1f5b984..34d2149 100644 > --- a/kdump/kdump.c > +++ b/kdump/kdump.c > @@ -284,7 +284,8 @@ int main(int argc, char **argv) > } > > /* Get the program header */ > - phdr = map_addr(fd, sizeof(*phdr)*(ehdr->e_phnum), ehdr->e_phoff); > + phdr = map_addr(fd, sizeof(*phdr)*(ehdr->e_phnum), > + start_addr + ehdr->e_phoff); > > /* Collect up the notes */ > note_bytes = 0; > -- > 1.9.1