2
0
mirror of https://github.com/edk2-porting/linux-next.git synced 2024-12-23 12:43:55 +08:00
linux-next/drivers/mtd/parsers
Colin Ian King b1d030f804 mtd: sharpslpart: fix overflow on block_adr calculation
Multiplying block_num and mtd->erasesize may potentially overflow
as they are both unsigned ints and so the multiplication is evaluated
in unsigned int arithmetic.  Cast block_adr to off_t to ensure
multiplication is off_t sized to avoid any potential overflow.

Detected by CoverityScan, CID#1461264 ("Unintentional integer overflow")

Signed-off-by: Colin Ian King <colin.king@canonical.com>
Acked-by: Andrea Adami <andrea.adami@gmail.com>
Signed-off-by: Boris Brezillon <boris.brezillon@free-electrons.com>
2017-12-18 13:30:04 +01:00
..
Kconfig mtd: sharpslpart: Add sharpslpart partition parser 2017-11-13 21:39:19 +01:00
Makefile mtd: sharpslpart: Add sharpslpart partition parser 2017-11-13 21:39:19 +01:00
parser_trx.c
sharpslpart.c mtd: sharpslpart: fix overflow on block_adr calculation 2017-12-18 13:30:04 +01:00