UBI: fix out of bounds write
authorBrian Norris <computersforpeace@gmail.com>
Sat, 28 Feb 2015 10:23:26 +0000 (02:23 -0800)
committerBen Hutchings <ben@decadent.org.uk>
Thu, 6 Aug 2015 23:32:01 +0000 (00:32 +0100)
commit4d1519d8538a6a91ffcd10d56a15f538804b5bad
treead725ce06e0df913c6e6ddef43d52fc2c91e18da
parent5daa0af639b0be923694f1e12f3029f0562f8dfc
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>
[bwh: Backported to 3.2: adjust context; s/leb/seb/g]
Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
drivers/mtd/ubi/eba.c