[lvc-project] [PATCH] f2fs: prevent possible int overflow in dir_block_index()
Chao Yu
chao at kernel.org
Thu Jul 25 06:21:50 MSK 2024
On 2024/7/25 1:05, Nikita Zhandarovich wrote:
> 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: 3843154598a0 ("f2fs: introduce large directory support")
> Cc: stable at vger.kernel.org
> Signed-off-by: Nikita Zhandarovich <n.zhandarovich at fintech.ru>
Reviewed-by: Chao Yu <chao at kernel.org>
Thanks,
More information about the lvc-project
mailing list