aboutsummaryrefslogtreecommitdiff
path: root/drivers/mtd
diff options
context:
space:
mode:
authorGravatar Denis Arefev <arefev@swemel.ru> 2024-03-15 12:37:58 +0300
committerGravatar Miquel Raynal <miquel.raynal@bootlin.com> 2024-03-25 11:17:16 +0100
commit1162bc2f8f5de7da23d18aa4b7fbd4e93c369c50 (patch)
tree9088f8ec729b463940e94d7e597395117de8b30f /drivers/mtd
parentdt-bindings: mtd: Add Samsung S5Pv210 OneNAND (diff)
downloadlinux-1162bc2f8f5de7da23d18aa4b7fbd4e93c369c50.tar.gz
linux-1162bc2f8f5de7da23d18aa4b7fbd4e93c369c50.tar.bz2
linux-1162bc2f8f5de7da23d18aa4b7fbd4e93c369c50.zip
mtd: partitions: redboot: Added conversion of operands to a larger type
The value of an arithmetic expression directory * master->erasesize is subject to overflow due to a failure to cast operands to a larger data type before perfroming arithmetic Found by Linux Verification Center (linuxtesting.org) with SVACE. Signed-off-by: Denis Arefev <arefev@swemel.ru> Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com> Link: https://lore.kernel.org/linux-mtd/20240315093758.20790-1-arefev@swemel.ru
Diffstat (limited to 'drivers/mtd')
-rw-r--r--drivers/mtd/parsers/redboot.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/mtd/parsers/redboot.c b/drivers/mtd/parsers/redboot.c
index a16b42a88581..3b55b676ca6b 100644
--- a/drivers/mtd/parsers/redboot.c
+++ b/drivers/mtd/parsers/redboot.c
@@ -102,7 +102,7 @@ nogood:
offset -= master->erasesize;
}
} else {
- offset = directory * master->erasesize;
+ offset = (unsigned long) directory * master->erasesize;
while (mtd_block_isbad(master, offset)) {
offset += master->erasesize;
if (offset == master->size)