diff options
author | Brian Pomerantz <bapper@piratehaven.org> | 2007-04-02 02:49:41 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@woody.linux-foundation.org> | 2007-04-02 13:06:08 -0400 |
commit | 03221702608c60b470fc86a23bdf4bc30e5bd59f (patch) | |
tree | ab83782a3ece940838604ac8a44676e9734b6909 /fs/binfmt_elf.c | |
parent | 2400ff77e7025bf6ffb71afdcbfbdd9aa47dfc36 (diff) |
[PATCH] fix page leak during core dump
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>
Cc: Hugh Dickins <hugh@veritas.com>
Cc: Nick Piggin <nickpiggin@yahoo.com.au>
Cc: David Howells <dhowells@redhat.com>
Cc: <stable@kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'fs/binfmt_elf.c')
-rw-r--r-- | fs/binfmt_elf.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/fs/binfmt_elf.c b/fs/binfmt_elf.c index a2fceba7ef8e..9cc4f0a8aaae 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) | |||
1704 | DUMP_SEEK(PAGE_SIZE); | 1704 | DUMP_SEEK(PAGE_SIZE); |
1705 | } else { | 1705 | } else { |
1706 | if (page == ZERO_PAGE(addr)) { | 1706 | if (page == ZERO_PAGE(addr)) { |
1707 | DUMP_SEEK(PAGE_SIZE); | 1707 | if (!dump_seek(file, PAGE_SIZE)) { |
1708 | page_cache_release(page); | ||
1709 | goto end_coredump; | ||
1710 | } | ||
1708 | } else { | 1711 | } else { |
1709 | void *kaddr; | 1712 | void *kaddr; |
1710 | flush_cache_page(vma, addr, | 1713 | flush_cache_page(vma, addr, |