diff options
| author | Nikita Zhandarovich <[email protected]> | 2025-01-24 22:20:53 +0000 |
|---|---|---|
| committer | Andrew Morton <[email protected]> | 2025-02-01 11:53:26 +0000 |
| commit | 6438ef381c183444f7f9d1de18f22661cba1e946 (patch) | |
| tree | d4de213518576ae0a48a33371f065930647e3d4b /lib/test_xarray.c | |
| parent | mm: compaction: use the proper flag to determine watermarks (diff) | |
| download | kernel-6438ef381c183444f7f9d1de18f22661cba1e946.tar.gz kernel-6438ef381c183444f7f9d1de18f22661cba1e946.zip | |
nilfs2: fix possible int overflows in nilfs_fiemap()
Since nilfs_bmap_lookup_contig() in nilfs_fiemap() calculates its result
by being prepared to go through potentially maxblocks == INT_MAX blocks,
the value in n may experience an overflow caused by left shift of blkbits.
While it is extremely unlikely to occur, play it safe and cast right hand
expression to wider type to mitigate the issue.
Found by Linux Verification Center (linuxtesting.org) with static analysis
tool SVACE.
Link: https://lkml.kernel.org/r/[email protected]
Fixes: 622daaff0a89 ("nilfs2: fiemap support")
Signed-off-by: Nikita Zhandarovich <[email protected]>
Signed-off-by: Ryusuke Konishi <[email protected]>
Cc: <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Diffstat (limited to 'lib/test_xarray.c')
0 files changed, 0 insertions, 0 deletions
