kernel_samsung_a53x/fs/ocfs2
Edward Adam Davis fb4fbc22a1 ocfs2: pass u64 to ocfs2_truncate_inline maybe overflow
[ Upstream commit bc0a2f3a73fcdac651fca64df39306d1e5ebe3b0 ]

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: 1afc32b95233 ("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>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2024-11-23 23:22:06 +01:00
..
cluster Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
dlm Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
dlmfs Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
acl.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
acl.h Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
alloc.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
alloc.h Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
aops.c ocfs2: fix uninit-value in ocfs2_get_block() 2024-11-23 23:21:44 +01:00
aops.h Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
blockcheck.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
blockcheck.h Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
buffer_head_io.c ocfs2: fix possible null-ptr-deref in ocfs2_set_buffer_uptodate 2024-11-23 23:21:44 +01:00
buffer_head_io.h Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
dcache.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
dcache.h Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
dir.c ocfs2: add bounds checking to ocfs2_check_dir_entry() 2024-11-19 14:19:51 +01:00
dir.h Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
dlmglue.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
dlmglue.h Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
export.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
export.h Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
extent_map.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
extent_map.h Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
file.c ocfs2: pass u64 to ocfs2_truncate_inline maybe overflow 2024-11-23 23:22:06 +01:00
file.h Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
filecheck.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
filecheck.h Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
heartbeat.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
heartbeat.h Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
inode.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
inode.h Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
ioctl.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
ioctl.h Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
journal.c ocfs2: fix null-ptr-deref when journal load failed. 2024-11-23 23:21:44 +01:00
journal.h ocfs2: fix DIO failure due to insufficient transaction credits 2024-11-19 14:19:33 +01:00
Kconfig Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
localalloc.c ocfs2: fix the la space leak when unmounting an ocfs2 volume 2024-11-23 23:21:44 +01:00
localalloc.h Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
locks.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
locks.h Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
Makefile Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
mmap.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
mmap.h Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
move_extents.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
move_extents.h Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
namei.c ocfs2: use coarse time for new created files 2024-11-19 14:19:04 +01:00
namei.h Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
ocfs1_fs_compat.h Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
ocfs2.h Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
ocfs2_fs.h Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
ocfs2_ioctl.h Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
ocfs2_lockid.h Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
ocfs2_lockingver.h Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
ocfs2_trace.h ocfs2: fix DIO failure due to insufficient transaction credits 2024-11-19 14:19:33 +01:00
quota.h Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
quota_global.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
quota_local.c ocfs2: cancel dqi_sync_work before freeing oinfo 2024-11-23 23:21:44 +01:00
refcounttree.c ocfs2: reserve space for inline xattr before attaching reflink tree 2024-11-23 23:21:44 +01:00
refcounttree.h Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
reservations.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
reservations.h Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
resize.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
resize.h Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
slot_map.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
slot_map.h Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
stack_o2cb.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
stack_user.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
stackglue.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
stackglue.h Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
suballoc.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
suballoc.h Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
super.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
super.h Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
symlink.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
symlink.h Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
sysfile.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
sysfile.h Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
uptodate.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
uptodate.h Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
xattr.c ocfs2: reserve space for inline xattr before attaching reflink tree 2024-11-23 23:21:44 +01:00
xattr.h Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00