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
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <f26426c0-3ce6-498c-9090-397e93b74d05@linux.alibaba.com>
Date: Tue, 19 Aug 2025 16:36:56 +0800
From: Baolin Wang <baolin.wang@...ux.alibaba.com>
To: libaokun@...weicloud.com, linux-mm@...ck.org
Cc: hughd@...gle.com, akpm@...ux-foundation.org, jlayton@...nel.org,
 linux-kernel@...r.kernel.org, Baokun Li <libaokun1@...wei.com>
Subject: Re: [PATCH] tmpfs: preserve SB_I_VERSION on remount



On 2025/8/19 14:18, libaokun@...weicloud.com wrote:
> From: Baokun Li <libaokun1@...wei.com>
> 
> Now tmpfs enables i_version by default and tmpfs does not modify it. But
> SB_I_VERSION can also be modified via sb_flags, and reconfigure_super()
> always overwrites the existing flags with the latest ones. This means that
> if tmpfs is remounted without specifying iversion, the default i_version
> will be unexpectedly disabled.
> 
> To ensure iversion remains enabled, SB_I_VERSION is now always set for
> fc->sb_flags in shmem_init_fs_context(), instead of for sb->s_flags in
> shmem_fill_super().
> 
> Fixes: 36f05cab0a2c ("tmpfs: add support for an i_version counter")
> Signed-off-by: Baokun Li <libaokun1@...wei.com>
> ---

Looks reasonable to me.
Reviewed-by: Baolin Wang <baolin.wang@...ux.alibaba.com>
Tested-by: Baolin Wang <baolin.wang@...ux.alibaba.com>

>   mm/shmem.c | 5 ++++-
>   1 file changed, 4 insertions(+), 1 deletion(-)
> 
> diff --git a/mm/shmem.c b/mm/shmem.c
> index e2c76a30802b..eebe12ff5bc6 100644
> --- a/mm/shmem.c
> +++ b/mm/shmem.c
> @@ -5081,7 +5081,7 @@ static int shmem_fill_super(struct super_block *sb, struct fs_context *fc)
>   		sb->s_flags |= SB_NOUSER;
>   	}
>   	sb->s_export_op = &shmem_export_ops;
> -	sb->s_flags |= SB_NOSEC | SB_I_VERSION;
> +	sb->s_flags |= SB_NOSEC;
>   
>   #if IS_ENABLED(CONFIG_UNICODE)
>   	if (!ctx->encoding && ctx->strict_encoding) {
> @@ -5385,6 +5385,9 @@ int shmem_init_fs_context(struct fs_context *fc)
>   
>   	fc->fs_private = ctx;
>   	fc->ops = &shmem_fs_context_ops;
> +#ifdef CONFIG_TMPFS
> +	fc->sb_flags |= SB_I_VERSION;
> +#endif
>   	return 0;
>   }
>   


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ