mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Roland McGrath <roland@redhat.com>
To: Linus Torvalds <torvalds@transmeta.com>
Cc: linux-kernel@vger.kernel.org
Subject: [PATCH] fix vsyscall page core dump segment size
Date: Fri, 16 May 2003 01:40:26 -0700	[thread overview]
Message-ID: <200305160840.h4G8eQb01924@magilla.sf.frob.com> (raw)

My change to core dumps that was included with the vsyscall DSO
implementation had a bug (braino on my part).  Core dumps don't include the
full page of the vsyscall DSO, and so don't accurately represent the whole
memory image of the process.  This patch fixes it.

arch/x86_64/ia32/ia32_binfmt.c's copy of this code needs the corresponding
update as well.  I don't include a patch since that code is not in the main
tree.


Thanks,
Roland


--- linux-2.5.69/include/asm-i386/elf.h.~1~	Sun May  4 16:53:35 2003
+++ linux-2.5.69/include/asm-i386/elf.h	Thu May 15 23:39:22 2003
@@ -149,7 +149,10 @@ do {									      \
 	for (i = 0; i < VSYSCALL_EHDR->e_phnum; ++i) {			      \
 		struct elf_phdr phdr = vsyscall_phdrs[i];		      \
 		if (phdr.p_type == PT_LOAD) {				      \
+			BUG_ON(ofs != 0);				      \
 			ofs = phdr.p_offset = offset;			      \
+			phdr.p_filesz = PAGE_ALIGN(phdr.p_filesz);	      \
+			phdr.p_memsz = PAGE_ALIGN(phdr.p_memsz);	      \
 			offset += phdr.p_filesz;			      \
 		}							      \
 		else							      \
@@ -167,7 +170,7 @@ do {									      \
 	for (i = 0; i < VSYSCALL_EHDR->e_phnum; ++i) {			      \
 		if (vsyscall_phdrs[i].p_type == PT_LOAD)		      \
 			DUMP_WRITE((void *) vsyscall_phdrs[i].p_vaddr,	      \
-				   vsyscall_phdrs[i].p_filesz);		      \
+				   PAGE_ALIGN(vsyscall_phdrs[i].p_filesz));   \
 	}								      \
 } while (0)
 

                 reply	other threads:[~2003-05-16  8:28 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=200305160840.h4G8eQb01924@magilla.sf.frob.com \
    --to=roland@redhat.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=torvalds@transmeta.com \
    /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

all inboxes | Powered by JetHome®