Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit d74adbdb authored by Brian Norris's avatar Brian Norris Committed by Richard Weinberger
Browse files

UBI: fix out of bounds write



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

Caught by Coverity, CID #711212.

Cc: stable <stable@vger.kernel.org>
Signed-off-by: default avatarBrian Norris <computersforpeace@gmail.com>
Signed-off-by: default avatarRichard Weinberger <richard@nod.at>
parent 8eef7d70
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -1419,6 +1419,7 @@ int ubi_eba_init(struct ubi_device *ubi, struct ubi_attach_info *ai)
				 * during re-size.
				 */
				ubi_move_aeb_to_list(av, aeb, &ai->erase);
			else
				vol->eba_tbl[aeb->lnum] = aeb->pnum;
		}
	}