Commit 4d1519d8 authored by Brian Norris's avatar Brian Norris Committed by Ben Hutchings

UBI: fix out of bounds write

commit d74adbdb 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: default avatarBrian Norris <computersforpeace@gmail.com>
Signed-off-by: default avatarRichard Weinberger <richard@nod.at>
[bwh: Backported to 3.2: adjust context; s/leb/seb/g]
Signed-off-by: default avatarBen Hutchings <ben@decadent.org.uk>
parent 5daa0af6
......@@ -1261,7 +1261,8 @@ int ubi_eba_init_scan(struct ubi_device *ubi, struct ubi_scan_info *si)
* during re-size.
*/
ubi_scan_move_to_list(sv, seb, &si->erase);
vol->eba_tbl[seb->lnum] = seb->pnum;
else
vol->eba_tbl[seb->lnum] = seb->pnum;
}
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment