linux/fs/ocfs2
Edward Adam Davis bc0a2f3a73 ocfs2: pass u64 to ocfs2_truncate_inline maybe overflow
Syzbot reported a kernel BUG in ocfs2_truncate_inline.  There are two
reasons for this: first, the parameter value passed is greater than
ocfs2_max_inline_data_with_xattr, second, the start and end parameters of
ocfs2_truncate_inline are "unsigned int".

So, we need to add a sanity check for byte_start and byte_len right before
ocfs2_truncate_inline() in ocfs2_remove_inode_range(), if they are greater
than ocfs2_max_inline_data_with_xattr return -EINVAL.

Link: https://lkml.kernel.org/r/tencent_D48DB5122ADDAEDDD11918CFB68D93258C07@qq.com
Fixes: 1afc32b952 ("ocfs2: Write support for inline data")
Signed-off-by: Edward Adam Davis <eadavis@qq.com>
Reported-by: syzbot+81092778aac03460d6b7@syzkaller.appspotmail.com
Closes: https://syzkaller.appspot.com/bug?extid=81092778aac03460d6b7
Reviewed-by: Joseph Qi <joseph.qi@linux.alibaba.com>
Cc: Joel Becker <jlbec@evilplan.org>
Cc: Joseph Qi <joseph.qi@linux.alibaba.com>
Cc: Mark Fasheh <mark@fasheh.com>
Cc: Junxiao Bi <junxiao.bi@oracle.com>
Cc: Changwei Ge <gechangwei@live.cn>
Cc: Gang He <ghe@suse.com>
Cc: Jun Piao <piaojun@huawei.com>
Cc: <stable@vger.kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
2024-10-28 21:40:40 -07:00
..
cluster
dlm
dlmfs
acl.c
acl.h
alloc.c
alloc.h
aops.c ocfs2: fix uninit-value in ocfs2_get_block() 2024-09-26 14:01:45 -07:00
aops.h
blockcheck.c
blockcheck.h
buffer_head_io.c
buffer_head_io.h
dcache.c
dcache.h
dir.c Many singleton patches - please see the various changelogs for details. 2024-09-21 08:20:50 -07:00
dir.h
dlmglue.c
dlmglue.h
export.c
export.h
extent_map.c ocfs2: fix deadlock in ocfs2_get_system_file_inode 2024-09-26 14:01:44 -07:00
extent_map.h
file.c ocfs2: pass u64 to ocfs2_truncate_inline maybe overflow 2024-10-28 21:40:40 -07:00
file.h
filecheck.c
filecheck.h
heartbeat.c
heartbeat.h
inode.c
inode.h
ioctl.c
ioctl.h
journal.c
journal.h
Kconfig
localalloc.c
localalloc.h
locks.c
locks.h
Makefile
mmap.c
mmap.h
move_extents.c
move_extents.h
namei.c
namei.h
ocfs1_fs_compat.h
ocfs2.h
ocfs2_fs.h
ocfs2_ioctl.h
ocfs2_lockid.h
ocfs2_lockingver.h
ocfs2_trace.h
quota.h
quota_global.c
quota_local.c
refcounttree.c ocfs2: reserve space for inline xattr before attaching reflink tree 2024-09-26 14:01:44 -07:00
refcounttree.h
reservations.c
reservations.h
resize.c
resize.h
slot_map.c
slot_map.h
stack_o2cb.c
stack_user.c
stackglue.c
stackglue.h
suballoc.c
suballoc.h
super.c \n 2024-09-23 10:49:28 -07:00
super.h
symlink.c
symlink.h
sysfile.c
sysfile.h
uptodate.c
uptodate.h
xattr.c ocfs2: reserve space for inline xattr before attaching reflink tree 2024-09-26 14:01:44 -07:00
xattr.h