linux/drivers/mtd/ubi
Vinit Agnihotri d08c3b78b8 UBI: fix overflow bug
I was experiencing overflows in multiplications for
volume->used_bytes in vmt.c & vtbl.c, while creating & resizing large volumes.

vol->used_bytes is long long however its 2 operands vol->used_ebs &
vol->usable_leb_size
are int. So their multiplication for larger values causes integer overflows.
Typecasting them solves the problem.

My machine & flash details:

64Bit dual-core AMD opteron, 1 GB RAM, linux 2.6.18.3.
mtd size = 6GB, volume size= 5GB, peb_size = 4MB.

heres patch which does the fix.

Signed-off-by: Vinit Agnihotri <vinit.agnihotri@gmail.com>
Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com>
2007-07-18 16:58:12 +03:00
..
build.c UBI: fix message 2007-07-18 16:56:13 +03:00
cdev.c UBI: cleanup ioctl handling 2007-07-18 16:53:36 +03:00
debug.c UBI: bugfix in error path 2007-07-18 16:55:55 +03:00
debug.h UBI: bugfix in error path 2007-07-18 16:55:55 +03:00
eba.c UBI: fix bug in atomic_leb_change() 2007-07-18 16:56:24 +03:00
gluebi.c UBI: set correct gluebi device size 2007-07-18 16:52:51 +03:00
io.c UBI: fix signed-unsigned multiplication 2007-07-18 16:57:34 +03:00
kapi.c UBI: do not let to read too much 2007-07-18 16:52:42 +03:00
Kconfig
Kconfig.debug
Makefile
misc.c UBI: use vmalloc for large buffers 2007-07-18 16:53:08 +03:00
scan.c UBI: bugfix in max_sqnum calculation 2007-07-18 16:58:02 +03:00
scan.h UBI: fix error path in create_vtbl() 2007-07-18 16:52:32 +03:00
ubi.h UBI: use vmalloc for large buffers 2007-07-18 16:53:08 +03:00
upd.c UBI: use vmalloc for large buffers 2007-07-18 16:53:08 +03:00
vmt.c UBI: fix overflow bug 2007-07-18 16:58:12 +03:00
vtbl.c UBI: fix overflow bug 2007-07-18 16:58:12 +03:00
wl.c UBI: kill homegrown endian macros 2007-07-18 16:53:49 +03:00