UBI: fix out of bounds write
authorBrian Norris <computersforpeace@gmail.com>
Sat, 28 Feb 2015 10:23:26 +0000 (02:23 -0800)
committerDanny Wood <danwood76@gmail.com>
Tue, 29 Jan 2019 13:08:11 +0000 (13:08 +0000)
commit276881aaf3e1557a51947f78d0a7a5d57c38f647
tree705ef0153bbd0fd2d8244279a42b81c9f413738f
parentd15d147e54a83b19e06abfcd3f3a6965c7fc5f9d
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