From: Denys Vlasenko Date: Wed, 26 Sep 2012 01:34:50 +0000 (+1000) Subject: coredump: prevent double-free on an error path in core dumper X-Git-Tag: v3.2.32~79 X-Git-Url: http://git.openpandora.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=02eb1e54072c0fedb20fc9458e2bbe8c4e820384;p=pandora-kernel.git coredump: prevent double-free on an error path in core dumper commit f34f9d186df35e5c39163444c43b4fc6255e39c5 upstream. In !CORE_DUMP_USE_REGSET case, if elf_note_info_init fails to allocate memory for info->fields, it frees already allocated stuff and returns error to its caller, fill_note_info. Which in turn returns error to its caller, elf_core_dump. Which jumps to cleanup label and calls free_note_info, which will happily try to free all info->fields again. BOOM. This is the fix. Signed-off-by: Oleg Nesterov Signed-off-by: Denys Vlasenko Cc: Venu Byravarasu Signed-off-by: Andrew Morton Signed-off-by: Ben Hutchings --- Reading git-diff-tree failed