LKML Archive on lore.kernel.org
help / color / mirror / Atom feed
* [PATCH] fix page leak during core dump
@ 2007-03-29 20:39 Brian Pomerantz
  2007-03-30 20:43 ` Andrew Morton
  0 siblings, 1 reply; 7+ messages in thread
From: Brian Pomerantz @ 2007-03-29 20:39 UTC (permalink / raw)
  To: viro; +Cc: linux-kernel


When the dump cannot occur most likely because of a full file system
and the page to be written is the zero page, the call to
page_cache_release() is missed.

Signed-off-by: Brian Pomerantz <bapper@mvista.com>

diff --git a/fs/binfmt_elf.c b/fs/binfmt_elf.c
index a2fceba..9cc4f0a 100644
--- a/fs/binfmt_elf.c
+++ b/fs/binfmt_elf.c
@@ -1704,7 +1704,10 @@ static int elf_core_dump(long signr, struct pt_regs *regs, struct file *file)
 				DUMP_SEEK(PAGE_SIZE);
 			} else {
 				if (page == ZERO_PAGE(addr)) {
-					DUMP_SEEK(PAGE_SIZE);
+					if (!dump_seek(file, PAGE_SIZE)) {
+						page_cache_release(page);
+						goto end_coredump;
+					}
 				} else {
 					void *kaddr;
 					flush_cache_page(vma, addr,

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2007-03-31 12:59 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2007-03-29 20:39 [PATCH] fix page leak during core dump Brian Pomerantz
2007-03-30 20:43 ` Andrew Morton
2007-03-30 22:01   ` Hugh Dickins
2007-03-30 22:13     ` Andrew Morton
2007-03-30 23:06       ` Hugh Dickins
2007-03-31 12:59       ` David Howells
2007-03-31 12:57     ` David Howells

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).