Unverified Commit 5eb98710 authored by Miklos Szeredi's avatar Miklos Szeredi Committed by Christian Brauner
Browse files

fs: fix adding security options to statmount.mnt_opt



Prepending security options was made conditional on sb->s_op->show_options,
but security options are independent of sb options.

Fixes: 056d3313 ("fs: prepend statmount.mnt_opts string with security_sb_mnt_opts()")
Fixes: f9af549d ("fs: export mount options via statmount()")
Cc: stable@vger.kernel.org # v6.11
Signed-off-by: default avatarMiklos Szeredi <mszeredi@redhat.com>
Link: https://lore.kernel.org/r/20250129151253.33241-1-mszeredi@redhat.com


Signed-off-by: default avatarChristian Brauner <brauner@kernel.org>
parent b06ddfee
Loading
Loading
Loading
Loading
+14 −15
Original line number Diff line number Diff line
@@ -5087,18 +5087,18 @@ static int statmount_mnt_opts(struct kstatmount *s, struct seq_file *seq)
{
	struct vfsmount *mnt = s->mnt;
	struct super_block *sb = mnt->mnt_sb;
	int err;

	if (sb->s_op->show_options) {
	size_t start = seq->count;
	int err;

	err = security_sb_show_options(seq, sb);
	if (err)
		return err;

	if (sb->s_op->show_options) {
		err = sb->s_op->show_options(seq, mnt->mnt_root);
		if (err)
			return err;
	}

	if (unlikely(seq_has_overflowed(seq)))
		return -EAGAIN;
@@ -5110,7 +5110,6 @@ static int statmount_mnt_opts(struct kstatmount *s, struct seq_file *seq)
	memmove(seq->buf + start, seq->buf + start + 1,
		seq->count - start - 1);
	seq->count--;
	}

	return 0;
}