linux-stable/fs/ufs
Colin Ian King e705251862 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 11:02:11 +02:00
..
Kconfig
Makefile ufs: get rid of ->setattr() for symlinks 2015-12-06 20:43:26 -05:00
balloc.c ufs: restore maintaining ->i_blocks 2017-06-14 15:06:01 +02:00
cylinder.c
dir.c fs: Replace CURRENT_TIME_SEC with current_time() for inode timestamps 2016-09-27 21:06:22 -04:00
file.c
ialloc.c fs: Replace CURRENT_TIME_SEC with current_time() for inode timestamps 2016-09-27 21:06:22 -04:00
inode.c ufs: we need to sync inode before freeing it 2018-11-10 07:42:49 -08:00
namei.c do d_instantiate/unlock_new_inode combinations safely 2018-05-30 07:50:16 +02:00
super.c fs/ufs: avoid potential u32 multiplication overflow 2020-08-21 11:02:11 +02:00
swab.h
ufs.h ufs: get rid of ->setattr() for symlinks 2015-12-06 20:43:26 -05:00
ufs_fs.h
util.c fs: have submit_bh users pass in op and flags separately 2016-06-07 13:41:38 -06:00
util.h ufs: fix braino in ufs_get_inode_gid() for solaris UFS flavour 2019-05-25 18:26:56 +02:00