Commit bb83cf0c authored by Nikita Zhandarovich's avatar Nikita Zhandarovich Committed by Matthias Männich
Browse files

UPSTREAM: f2fs: prevent possible int overflow in dir_block_index()



The result of multiplication between values derived from functions
dir_buckets() and bucket_blocks() *could* technically reach
2^30 * 2^2 = 2^32.

While unlikely to happen, it is prudent to ensure that it will not
lead to integer overflow. Thus, use mul_u32_u32() as it's more
appropriate to mitigate the issue.

Found by Linux Verification Center (linuxtesting.org) with static
analysis tool SVACE.

Fixes: 38431545 ("f2fs: introduce large directory support")
Cc: stable@vger.kernel.org
Change-Id: If95a55dc62b75eeff2b97bbdb84854e5dbb44dd7
Signed-off-by: default avatarNikita Zhandarovich <n.zhandarovich@fintech.ru>
Reviewed-by: default avatarChao Yu <chao@kernel.org>
Signed-off-by: default avatarJaegeuk Kim <jaegeuk@kernel.org>
(cherry picked from commit 47f268f3)
parent 58c6526f
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment