]> git.karo-electronics.de Git - karo-tx-linux.git/commit
binfmt_elf: fix corner case kfree of uninitialized data
authorAlan Cox <alan@linux.intel.com>
Thu, 25 Oct 2012 01:15:08 +0000 (12:15 +1100)
committerStephen Rothwell <sfr@canb.auug.org.au>
Thu, 1 Nov 2012 04:24:15 +0000 (15:24 +1100)
commitcb2102fdb2a69ac1e663608480da64339587185a
treead8f30fe9a5018967b32ec4ec52c61bd621d11af
parentba9d2172b831fb0cbe5c0afa882bc9f21d7dc297
binfmt_elf: fix corner case kfree of uninitialized data

If elf_core_dump() is called and fill_note_info() fails in the kmalloc()
then it returns 0 but has not yet initialised all the needed fields.  As a
result we do a kfree(randomness) after correctly skipping the thread data.

Signed-off-by: Alan Cox <alan@linux.intel.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
fs/binfmt_elf.c