summaryrefslogtreecommitdiff
path: root/scripts
diff options
context:
space:
mode:
authorJoseph Qi <joseph.qi@linux.alibaba.com>2026-09-05 22:21:44 +0800
committerAndrew Morton <akpm@linux-foundation.org>2026-10-06 19:03:04 -0700
commit9e35bebc8b25fee008b4e7d4bb1a07dcfd4c1743 (patch)
treee11702064d310e497405db5984907f1875fdd66c /scripts
parent7b9f248353afc634b3b713b2ec662dac58f3820f (diff)
downloadlinux-next-9e35bebc8b25fee008b4e7d4bb1a07dcfd4c1743.tar.gz
linux-next-9e35bebc8b25fee008b4e7d4bb1a07dcfd4c1743.zip
ocfs2: validate dl_blkno and dl_fs_generation of dir index leaf blocks
ocfs2_validate_dx_leaf() checks the checksum, the signature and the entry list counts, but it never checks dl_blkno or dl_fs_generation. The inode, extent block, xattr block, refcount block and dir index root validators all check the on-disk block number against bh->b_blocknr and the generation against the superblock, and both dir index leaf fields are documented as "Must match super block". Without the checks, a stale dir index leaf block left on the device from a previously formatted filesystem at the same physical block number can pass validation as long as its signature, entry counts and checksum match. Its index entries would then be used in the new filesystem context. Both fields are written unconditionally when a leaf block is formatted in ocfs2_dx_dir_format_cluster(), from the live superblock generation and the real block number, so a correctly formatted filesystem cannot trip the new checks. The leaf block number read back here comes from on-disk dir index root extent records. Reject dir index leaf blocks whose dl_blkno or dl_fs_generation does not match, like the dir index root validator does. Link: https://lore.kernel.org/20260905142144.2869105-2-joseph.qi@linux.alibaba.com Signed-off-by: Joseph Qi <joseph.qi@linux.alibaba.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> 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>
Diffstat (limited to 'scripts')
0 files changed, 0 insertions, 0 deletions