[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>
This commit is contained in:

committed by
Linus Torvalds

parent
2400ff77e7
commit
0322170260
@@ -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,
|
||||
|
Reference in New Issue
Block a user