linux-stable/fs/ufs
Colin Ian King 3457ba1ace fs/ufs: avoid potential u32 multiplication overflow
[ Upstream commit 88b2e9b063 ]

The 64 bit ino is being compared to the product of two u32 values,
however, the multiplication is being performed using a 32 bit multiply so
there is a potential of an overflow.  To be fully safe, cast uspi->s_ncg
to a u64 to ensure a 64 bit multiplication occurs to avoid any chance of
overflow.

Fixes: f3e2a520f5 ("ufs: NFS support")
Signed-off-by: Colin Ian King <colin.king@canonical.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Cc: Evgeniy Dushistov <dushistov@mail.ru>
Cc: Alexey Dobriyan <adobriyan@gmail.com>
Link: http://lkml.kernel.org/r/20200715170355.1081713-1-colin.king@canonical.com
Addresses-Coverity: ("Unintentional integer overflow")
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2020-08-21 13:05:37 +02:00
..
balloc.c fs/ufs: use ktime_get_real_seconds for sb and cg timestamps 2018-08-17 16:20:27 -07:00
cylinder.c
dir.c
file.c
ialloc.c fs/ufs: use ktime_get_real_seconds for sb and cg timestamps 2018-08-17 16:20:27 -07:00
inode.c
Kconfig docs: fix a couple of new broken references 2019-07-31 14:12:26 -06:00
Makefile treewide: Add SPDX license identifier - Makefile/Kconfig 2019-05-21 10:50:46 +02:00
namei.c
super.c fs/ufs: avoid potential u32 multiplication overflow 2020-08-21 13:05:37 +02:00
swab.h
ufs.h
ufs_fs.h
util.c
util.h Wimplicit-fallthrough patches for 5.2-rc1 2019-05-07 12:48:10 -07:00