android_kernel_samsung_sm8650/drivers/mtd/ubi
Zhihao Cheng 91aeb418b9 ubi: Refuse attaching if mtd's erasesize is 0
[ Upstream commit 017c73a34a661a861712f7cc1393a123e5b2208c ]

There exists mtd devices with zero erasesize, which will trigger a
divide-by-zero exception while attaching ubi device.
Fix it by refusing attaching if mtd's erasesize is 0.

Fixes: 801c135ce7 ("UBI: Unsorted Block Images")
Reported-by: Yu Hao <yhao016@ucr.edu>
Link: https://lore.kernel.org/lkml/977347543.226888.1682011999468.JavaMail.zimbra@nod.at/T/
Signed-off-by: Zhihao Cheng <chengzhihao1@huawei.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>
Signed-off-by: Richard Weinberger <richard@nod.at>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2023-10-10 22:00:39 +02:00
..
attach.c mtd: Convert fallthrough comments into statements 2020-03-30 10:14:54 +02:00
block.c ubi: block: Fix typos in comments 2022-09-21 11:32:27 +02:00
build.c ubi: Refuse attaching if mtd's erasesize is 0 2023-10-10 22:00:39 +02:00
cdev.c ubi: fastmap: Add fastmap control support for 'UBI_IOCATT' ioctl 2022-09-21 18:29:18 +02:00
debug.c treewide: use prandom_u32_max() when possible, part 1 2022-10-11 17:42:55 -06:00
debug.h treewide: use prandom_u32_max() when possible, part 1 2022-10-11 17:42:55 -06:00
eba.c ubi: Fix return value overwrite issue in try_write_vid_and_data() 2023-05-11 23:03:05 +09:00
fastmap-wl.c ubi: fastmap: Fix missed fm_anchor PEB in wear-leveling after disabling fastmap 2023-03-11 13:55:21 +01:00
fastmap.c ubi: fastmap: Use the bitmap API to allocate bitmaps 2022-09-21 11:32:58 +02:00
gluebi.c mtd: ubi: gluebi: Fix misnamed function parameter documentation 2020-11-20 12:37:32 +01:00
io.c ubi: Fix repeated words in comments 2022-09-21 11:32:27 +02:00
kapi.c mtd: ubi: kapi: Correct documentation for 'ubi_leb_read_sg's 'sgl' parameter 2020-11-20 12:37:31 +01:00
Kconfig
Makefile
misc.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 156 2019-05-30 11:26:35 -07:00
ubi-media.h ubi: ubi-media.h: Fix comment typo 2022-09-21 11:12:18 +02:00
ubi.h ubi: fastmap: Add fastmap control support for 'UBI_IOCATT' ioctl 2022-09-21 18:29:18 +02:00
upd.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 156 2019-05-30 11:26:35 -07:00
vmt.c ubi: Fix possible null-ptr-deref in ubi_free_volume() 2023-03-11 13:55:20 +01:00
vtbl.c ubi: Free the normal volumes in error paths of ubi_attach_mtd_dev() 2020-01-16 23:35:59 +01:00
wl.c ubi: Fix deadlock caused by recursively holding work_sem 2023-04-20 12:35:14 +02:00
wl.h ubi: fastmap: Check wl_pool for free peb before wear leveling 2022-05-27 16:49:07 +02:00