]> git.baikalelectronics.ru Git - kernel.git/commit
fs/ntfs3: Fix integer overflow in multiplication
authorColin Ian King <colin.king@canonical.com>
Mon, 16 Aug 2021 16:30:25 +0000 (17:30 +0100)
committerKonstantin Komarov <almaz.alexandrovich@paragon-software.com>
Fri, 27 Aug 2021 14:05:10 +0000 (17:05 +0300)
commit2f3ea1940a03d33a5afa922fad57e5d94c6c8d45
tree1445c0fd8c145c02786f3cab2ef6ed814b11ccb8
parent3833b7a6b30fd7ef07d47a1c97a9fabe9a1b1568
fs/ntfs3: Fix integer overflow in multiplication

The multiplication of the u32 data_size with a int is being performed
using 32 bit arithmetic however the results is being assigned to the
variable nbits that is a size_t (64 bit) value. Fix a potential
integer overflow by casting the u32 value to a size_t before the
multiply to use a size_t sized bit multiply operation.

Addresses-Coverity: ("Unintentional integer overflow")
Fixes: d446689e2f28 ("fs/ntfs3: Add initialization of super block")
Signed-off-by: Colin Ian King <colin.king@canonical.com>
Signed-off-by: Konstantin Komarov <almaz.alexandrovich@paragon-software.com>
fs/ntfs3/index.c