OSDN Git Service

UBI: fix out of bounds write
authorBrian Norris <computersforpeace@gmail.com>
Sat, 28 Feb 2015 10:23:26 +0000 (02:23 -0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 6 May 2015 20:03:52 +0000 (22:03 +0200)
commit921b47c10b2b18b3562152aa0eacc1b2e56c6996
tree736593d97b870d204d60bb4421004753dc1a948e
parent67e9563f2e494959696ff3128cf9d5fb1b3dbad7
UBI: fix out of bounds write

commit d74adbdb9abf0d2506a6c4afa534d894f28b763f upstream.

If aeb->len >= vol->reserved_pebs, we should not be writing aeb into the
PEB->LEB mapping.

Caught by Coverity, CID #711212.

Signed-off-by: Brian Norris <computersforpeace@gmail.com>
Signed-off-by: Richard Weinberger <richard@nod.at>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/mtd/ubi/eba.c