[Devel] [PATCH vz10 1/2] fs: prepend statmount.mnt_opts string with security_sb_mnt_opts()

Vasileios Almpanis vasileios.almpanis at virtuozzo.com
Thu May 28 15:08:18 MSK 2026


Reviewed-by: Vasileios Almpanis <vasileios.almpanis at virtuozzo.com>

On 5/24/26 5:26 PM, Eva Kurchatova wrote:
> From: Jeff Layton <jlayton at kernel.org>
>
> Currently these mount options aren't accessible via statmount().
>
> The read handler for /proc/#/mountinfo calls security_sb_show_options()
> to emit the security options after emitting superblock flag options, but
> before calling sb->s_op->show_options.
>
> Have statmount_mnt_opts() call security_sb_show_options() before
> calling ->show_options.
>
> Signed-off-by: Jeff Layton <jlayton at kernel.org>
> Link: https://lore.kernel.org/r/20241115-statmount-v2-2-cd29aeff9cbb@kernel.org
> Signed-off-by: Christian Brauner <brauner at kernel.org>
>
> (cherry picked from commit 056d33137bf9364456ee70aa265ccbb948daee49)
> Signed-off-by: Eva Kurchatova <eva.kurchatova at virtuozzo.com>
>
> https://virtuozzo.atlassian.net/browse/VSTOR-132443
> Feature: Fix selftests
> ---
>   fs/namespace.c | 4 ++++
>   1 file changed, 4 insertions(+)
>
> diff --git a/fs/namespace.c b/fs/namespace.c
> index d18aaba94131..8f8161a555a6 100644
> --- a/fs/namespace.c
> +++ b/fs/namespace.c
> @@ -5307,6 +5307,10 @@ static int statmount_mnt_opts(struct kstatmount *s, struct seq_file *seq)
>   	if (sb->s_op->show_options) {
>   		size_t start = seq->count;
>   
> +		err = security_sb_show_options(seq, sb);
> +		if (err)
> +			return err;
> +
>   		err = sb->s_op->show_options(seq, mnt->mnt_root);
>   		if (err)
>   			return err;

-- 
Best regards, Vasileios Almpanis
Software Developer, Virtuozzo.



More information about the Devel mailing list