[PATCH] ubi: Reject device with erasesize 0

Jan Kara jack at suse.cz
Fri Sep 1 02:37:26 PDT 2023


On Fri 01-09-23 10:25:11, Tudor Ambarus wrote:
> Hi, Richard,
> 
> On 8/31/23 12:11, Jan Kara wrote:
> > In principle MTD device with erasesize 0 can exist and it is possible to create them e.g. via KVM. If that happens UBI layer currently crashes
> 
> mtd devices are organized in erase blocks, having a mtd with erase
> size zero looks suspicious to me. Do you know if there are any mtd
> devices with erasesize of zero?

Please see the discussion I've referenced from the patch. I agree such
devices are strange but apparently devices reporting erasesize==0 do exist
and can be created in virtualized environment. IMO we don't need to work
with them but we shouldn't crash a kernel if they are attached...

								Honza

-- 
Jan Kara <jack at suse.com>
SUSE Labs, CR



More information about the linux-mtd mailing list