* [merged mm-nonmm-stable] ocfs2-validate-dr_fs_generation-of-dir-index-root-blocks.patch removed from -mm tree
@ 2026-10-07 2:04 Andrew Morton
0 siblings, 0 replies; only message in thread
From: Andrew Morton @ 2026-10-07 2:04 UTC (permalink / raw)
To: mm-commits, piaojun, mark, junxiao.bi, jlbec, heming.zhao,
gechangwei, joseph.qi, akpm
The quilt patch titled
Subject: ocfs2: validate dr_fs_generation of dir index root blocks
has been removed from the -mm tree. Its filename was
ocfs2-validate-dr_fs_generation-of-dir-index-root-blocks.patch
This patch was dropped because it was merged into the mm-nonmm-stable branch
of git://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm
------------------------------------------------------
From: Joseph Qi <joseph.qi@linux.alibaba.com>
Subject: ocfs2: validate dr_fs_generation of dir index root blocks
Date: Sat, 5 Sep 2026 22:21:43 +0800
ocfs2_validate_dx_root() does not verify dr_fs_generation against the
superblock generation, unlike the extent and xattr block validators which
check h_fs_generation and xb_fs_generation respectively. The field is
documented as "Must match super block".
Without the check, a stale dir index root block left on the device from
a previously formatted filesystem at the same physical block number can
pass validation as long as its signature, dr_blkno and checksum match.
Its index entries and suballocator information would then be used in
the new filesystem context.
Reject dir index root blocks whose dr_fs_generation does not match the
mounted filesystem, like the extent and xattr block validators do.
Link: https://lore.kernel.org/20260905142144.2869105-1-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: Changwei Ge <gechangwei@live.cn>
Cc: Joel Becker <jlbec@evilplan.org>
Cc: Jun Piao <piaojun@huawei.com>
Cc: Junxiao Bi <junxiao.bi@oracle.com>
Cc: Mark Fasheh <mark@fasheh.com>
---
fs/ocfs2/dir.c | 8 ++++++++
1 file changed, 8 insertions(+)
--- a/fs/ocfs2/dir.c~ocfs2-validate-dr_fs_generation-of-dir-index-root-blocks
+++ a/fs/ocfs2/dir.c
@@ -613,6 +613,14 @@ static int ocfs2_validate_dx_root(struct
goto bail;
}
+ if (le32_to_cpu(dx_root->dr_fs_generation) != OCFS2_SB(sb)->fs_generation) {
+ ret = ocfs2_error(sb,
+ "Dir Index Root # %llu has an invalid dr_fs_generation of #%u\n",
+ (unsigned long long)bh->b_blocknr,
+ le32_to_cpu(dx_root->dr_fs_generation));
+ goto bail;
+ }
+
/*
* Dir index root blocks are allocated from a per-slot suballocator,
* so the slot must be in range. Otherwise removing the index passes
_
Patches currently in -mm which might be from joseph.qi@linux.alibaba.com are
ocfs2-retain-all-security-xattrs-during-inode-creation.patch
ocfs2-restore-erange-check-in-ocfs2_xattr_tree_list_index_block.patch
ocfs2-fix-possible-deadlock-between-nfs_sync_rwlock-and-fs_reclaim.patch
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2026-10-07 2:04 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-10-07 2:04 [merged mm-nonmm-stable] ocfs2-validate-dr_fs_generation-of-dir-index-root-blocks.patch removed from -mm tree Andrew Morton
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.