Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

ocfs2: add extra consistency check to ocfs2_dx_dir_lookup_rec()

In 'ocfs2_dx_dir_lookup_rec()', check whether an extent list length of the
directory indexing block matches the one configured via the superblock
parameters established at mount, thus preventing an out-of-bounds accesses
while iterating over the extent records below.

Link: https://lkml.kernel.org/r/20251007094626.196143-1-dmantipov@yandex.ru
Reported-by: syzbot+30b53487d00b4f7f0922@syzkaller.appspotmail.com
Closes: https://syzkaller.appspot.com/bug?extid=30b53487d00b4f7f0922
Signed-off-by: Dmitry Antipov <dmantipov@yandex.ru>
Reviewed-by: Joseph Qi <joseph.qi@linux.alibaba.com>
Reviewed-by: Heming Zhao <heming.zhao@suse.com>>
Cc: Mark Fasheh <mark@fasheh.com>
Cc: Joel Becker <jlbec@evilplan.org>
Cc: Junxiao Bi <junxiao.bi@oracle.com>
Cc: Changwei Ge <gechangwei@live.cn>
Cc: Jun Piao <piaojun@huawei.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>

authored by

Dmitry Antipov and committed by
Andrew Morton
1b34743c 2f26f58d

+8
+8
fs/ocfs2/dir.c
··· 778 778 struct ocfs2_extent_block *eb; 779 779 struct ocfs2_extent_rec *rec = NULL; 780 780 781 + if (le16_to_cpu(el->l_count) != 782 + ocfs2_extent_recs_per_dx_root(inode->i_sb)) { 783 + ret = ocfs2_error(inode->i_sb, 784 + "Inode %lu has invalid extent list length %u\n", 785 + inode->i_ino, le16_to_cpu(el->l_count)); 786 + goto out; 787 + } 788 + 781 789 if (el->l_tree_depth) { 782 790 ret = ocfs2_find_leaf(INODE_CACHE(inode), el, major_hash, 783 791 &eb_bh);