lists.openwall.net | lists / announce owl-users owl-dev john-users john-dev passwdqc-users yescrypt popa3d-users / oss-security kernel-hardening musl sabotage tlsify passwords / crypt-dev xvendor / Bugtraq Full-Disclosure linux-kernel linux-netdev linux-ext4 linux-hardening linux-cve-announce PHC | |
Open Source and information security mailing list archives
| ||
|
Message-ID: <6zslpjdu6urzex23d45n47myfzqmksphjz4bin6tpsxi7wqey2@nbmumzwl7255> Date: Thu, 3 Jul 2025 18:41:48 +0200 From: Jan Kara <jack@...e.cz> To: libaokun@...weicloud.com Cc: linux-ext4@...r.kernel.org, tytso@....edu, adilger.kernel@...ger.ca, jack@...e.cz, linux-kernel@...r.kernel.org, yi.zhang@...wei.com, yangerkun@...wei.com, libaokun1@...wei.com Subject: Re: [PATCH 2/2] ext4: preserve SB_I_VERSION on remount On Thu 03-07-25 15:39:03, libaokun@...weicloud.com wrote: > From: Baokun Li <libaokun1@...wei.com> > > IMA testing revealed that after an ext4 remount, file accesses triggered > full measurements even without modifications, instead of skipping as > expected when i_version is unchanged. > > Debugging showed `SB_I_VERSION` was cleared in reconfigure_super() during > remount due to commit 1ff20307393e ("ext4: unconditionally enable the > i_version counter") removing the fix from commit 960e0ab63b2e ("ext4: fix > i_version handling on remount"). > > To rectify this, `SB_I_VERSION` is always set for `fc->sb_flags` in > ext4_init_fs_context(), instead of `sb->s_flags` in __ext4_fill_super(), > ensuring it persists across all mounts. > > Fixes: 1ff20307393e ("ext4: unconditionally enable the i_version counter") > Signed-off-by: Baokun Li <libaokun1@...wei.com> Looks good. Feel free to add: Reviewed-by: Jan Kara <jack@...e.cz> Honza > --- > fs/ext4/super.c | 6 +++--- > 1 file changed, 3 insertions(+), 3 deletions(-) > > diff --git a/fs/ext4/super.c b/fs/ext4/super.c > index 9203518786e4..ed1b36bd51c8 100644 > --- a/fs/ext4/super.c > +++ b/fs/ext4/super.c > @@ -1998,6 +1998,9 @@ int ext4_init_fs_context(struct fs_context *fc) > fc->fs_private = ctx; > fc->ops = &ext4_context_ops; > > + /* i_version is always enabled now */ > + fc->sb_flags |= SB_I_VERSION; > + > return 0; > } > > @@ -5316,9 +5319,6 @@ static int __ext4_fill_super(struct fs_context *fc, struct super_block *sb) > sb->s_flags = (sb->s_flags & ~SB_POSIXACL) | > (test_opt(sb, POSIX_ACL) ? SB_POSIXACL : 0); > > - /* i_version is always enabled now */ > - sb->s_flags |= SB_I_VERSION; > - > /* HSM events are allowed by default. */ > sb->s_iflags |= SB_I_ALLOW_HSM; > > -- > 2.46.1 > -- Jan Kara <jack@...e.com> SUSE Labs, CR
Powered by blists - more mailing lists