public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] Memory corruption in block2mtd.c
@ 2008-03-20 14:36 Ingo van Lil
  2008-03-20 17:35 ` Jörn Engel
  0 siblings, 1 reply; 2+ messages in thread
From: Ingo van Lil @ 2008-03-20 14:36 UTC (permalink / raw)
  To: linux-kernel

Hello everybody,

the block2mtd driver (drivers/mtd/devices/block2mtd.c) will kfree an
on-stack pointer when handling an invalid argument line (e.g.
block2mtd=/dev/loop0,xxx).

The kfree was added some time ago when "name" was dynamically
allocated.

Cheers,
Ingo

Signed-off-by: Ingo van Lil <inguin@gmx.de>
---

--- linux-2.6.23.1/drivers/mtd/devices/block2mtd.c.orig	2008-03-20 15:13:49.000000000 +0100
+++ linux-2.6.23.1/drivers/mtd/devices/block2mtd.c	2008-03-20 15:14:09.000000000 +0100
@@ -408,7 +408,6 @@
  	if (token[1]) {
  		ret = parse_num(&erase_size, token[1]);
  		if (ret) {
-			kfree(name);
  			parse_err("illegal erase size");
  		}
  	}

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2008-03-20 18:34 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-03-20 14:36 [PATCH] Memory corruption in block2mtd.c Ingo van Lil
2008-03-20 17:35 ` Jörn Engel

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox