ubi: Check for too small LEB size in VTBL code
authorRichard Weinberger <richard@nod.at>
Wed, 24 Jan 2024 06:37:02 +0000 (07:37 +0100)
committerRichard Weinberger <richard@nod.at>
Sun, 25 Feb 2024 20:19:42 +0000 (21:19 +0100)
commit68a24aba7c593eafa8fd00f2f76407b9b32b47a9
tree37b2fac8deaa8c61958a421e6f9a270f676fc5c0
parenteb54235315f4577b035c89a10ca3eb48caab0445
ubi: Check for too small LEB size in VTBL code

If the LEB size is smaller than a volume table record we cannot
have volumes.
In this case abort attaching.

Cc: Chenyuan Yang <cy54@illinois.edu>
Cc: stable@vger.kernel.org
Fixes: 801c135ce73d ("UBI: Unsorted Block Images")
Reported-by: Chenyuan Yang <cy54@illinois.edu>
Closes: https://lore.kernel.org/linux-mtd/1433EB7A-FC89-47D6-8F47-23BE41B263B3@illinois.edu/
Signed-off-by: Richard Weinberger <richard@nod.at>
Reviewed-by: Zhihao Cheng <chengzhihao1@huawei.com>
drivers/mtd/ubi/vtbl.c