linux-kernelorg-stable/fs/nilfs2
Nikita Zhandarovich 6438ef381c 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/20250124222133.5323-1-konishi.ryusuke@gmail.com
Fixes: 622daaff0a ("nilfs2: fiemap support")
Signed-off-by: Nikita Zhandarovich <n.zhandarovich@fintech.ru>
Signed-off-by: Ryusuke Konishi <konishi.ryusuke@gmail.com>
Cc: <stable@vger.kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
2025-02-01 03:53:26 -08:00
..
Kconfig
Makefile
alloc.c nilfs2: add missing return value kernel-doc descriptions 2025-01-24 22:47:25 -08:00
alloc.h nilfs2: add missing return value kernel-doc descriptions 2025-01-24 22:47:25 -08:00
bmap.c nilfs2: correct return value kernel-doc descriptions for bmap functions 2025-01-24 22:47:25 -08:00
bmap.h
btnode.c nilfs2: revise the return value description style for consistency. 2025-01-24 22:47:25 -08:00
btnode.h
btree.c nilfs2: correct return value kernel-doc descriptions for bmap functions 2025-01-24 22:47:25 -08:00
btree.h
cpfile.c nilfs2: revise the return value description style for consistency. 2025-01-24 22:47:25 -08:00
cpfile.h
dat.c nilfs2: revise the return value description style for consistency. 2025-01-24 22:47:25 -08:00
dat.h
dir.c nilfs2: handle errors that nilfs_prepare_chunk() may return 2025-01-24 22:47:25 -08:00
direct.c
direct.h
export.h
file.c
gcinode.c nilfs2: correct return value kernel-doc descriptions for the rest 2025-01-24 22:47:25 -08:00
ifile.c nilfs2: revise the return value description style for consistency. 2025-01-24 22:47:25 -08:00
ifile.h
inode.c nilfs2: fix possible int overflows in nilfs_fiemap() 2025-02-01 03:53:26 -08:00
ioctl.c nilfs2: revise the return value description style for consistency. 2025-01-24 22:47:25 -08:00
mdt.c nilfs2: add missing return value kernel-doc descriptions 2025-01-24 22:47:25 -08:00
mdt.h
namei.c nilfs2: do not update mtime of renamed directory that is not moved 2025-01-24 22:47:26 -08:00
nilfs.h nilfs2: handle errors that nilfs_prepare_chunk() may return 2025-01-24 22:47:25 -08:00
page.c nilfs2: add missing return value kernel-doc descriptions 2025-01-24 22:47:25 -08:00
page.h
recovery.c nilfs2: add missing return value kernel-doc descriptions 2025-01-24 22:47:25 -08:00
segbuf.c nilfs2: correct return value kernel-doc descriptions for the rest 2025-01-24 22:47:25 -08:00
segbuf.h
segment.c nilfs2: revise the return value description style for consistency. 2025-01-24 22:47:25 -08:00
segment.h
sufile.c nilfs2: revise the return value description style for consistency. 2025-01-24 22:47:25 -08:00
sufile.h nilfs2: add missing return value kernel-doc descriptions 2025-01-24 22:47:25 -08:00
super.c nilfs2: add missing return value kernel-doc descriptions 2025-01-24 22:47:25 -08:00
sysfs.c
sysfs.h
the_nilfs.c nilfs2: add missing return value kernel-doc descriptions 2025-01-24 22:47:25 -08:00
the_nilfs.h