]> git.karo-electronics.de Git - karo-tx-linux.git/commit
mtd: sm_ftl: heap corruption in sm_create_sysfs_attributes()
authorDan Carpenter <dan.carpenter@oracle.com>
Thu, 5 Dec 2013 14:53:50 +0000 (17:53 +0300)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 13 May 2014 11:32:55 +0000 (13:32 +0200)
commit93dd8b49c22623eb72a10beb44926dbd948c3618
tree836f44b4b2067230ac08045abea01c7989e06181
parent9ef4bb8b24c83617043c6804fb547dbe1c4d9052
mtd: sm_ftl: heap corruption in sm_create_sysfs_attributes()

commit b4c233057771581698a13694ab6f33b48ce837dc upstream.

We always put a NUL terminator one space past the end of the "vendor"
buffer.  Walter Harms also pointed out that this should just use
kstrndup().

Fixes: 7d17c02a01a1 ('mtd: Add new SmartMedia/xD FTL')
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Brian Norris <computersforpeace@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/mtd/sm_ftl.c