Fix for buffer overflow in ldm_frag_add not sufficient
commit60bdd71df9c36e1e1710155fded924e93347a9d2
authorTimo Warns <Warns@pre-sense.de>
Thu, 19 May 2011 07:24:17 +0000 (19 09:24 +0200)
committerAndi Kleen <ak@linux.intel.com>
Mon, 1 Aug 2011 20:54:51 +0000 (1 13:54 -0700)
tree8b55e0870c1f88082282a7660e6fb214cf0d31e2
parentc8648b4c2b720f21cba4040e47ce8dbc6e93ef8f
Fix for buffer overflow in ldm_frag_add not sufficient

commit cae13fe4cc3f24820ffb990c09110626837e85d4 upstream.

As Ben Hutchings discovered [1], the patch for CVE-2011-1017 (buffer
overflow in ldm_frag_add) is not sufficient.  The original patch in
commit c340b1d64000 ("fs/partitions/ldm.c: fix oops caused by corrupted
partition table") does not consider that, for subsequent fragments,
previously allocated memory is used.

[1] http://lkml.org/lkml/2011/5/6/407

Reported-by: Ben Hutchings <ben@decadent.org.uk>
Signed-off-by: Timo Warns <warns@pre-sense.de>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Signed-off-by: Andi Kleen <ak@linux.intel.com>
fs/partitions/ldm.c