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:056d33137b
("fs: prepend statmount.mnt_opts string with security_sb_mnt_opts()") Fixes:f9af549d1f
("fs: export mount options via statmount()") Cc: stable@vger.kernel.org # v6.11 Signed-off-by: Miklos Szeredi <mszeredi@redhat.com> Link: https://lore.kernel.org/r/20250129151253.33241-1-mszeredi@redhat.com Signed-off-by: Christian Brauner <brauner@kernel.org>
This commit is contained in:
parent
b06ddfeedc
commit
5eb9871053
1 changed files with 16 additions and 17 deletions
|
@ -5087,31 +5087,30 @@ static int statmount_mnt_opts(struct kstatmount *s, struct seq_file *seq)
|
|||
{
|
||||
struct vfsmount *mnt = s->mnt;
|
||||
struct super_block *sb = mnt->mnt_sb;
|
||||
size_t start = seq->count;
|
||||
int err;
|
||||
|
||||
err = security_sb_show_options(seq, sb);
|
||||
if (err)
|
||||
return err;
|
||||
|
||||
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;
|
||||
|
||||
if (unlikely(seq_has_overflowed(seq)))
|
||||
return -EAGAIN;
|
||||
|
||||
if (seq->count == start)
|
||||
return 0;
|
||||
|
||||
/* skip leading comma */
|
||||
memmove(seq->buf + start, seq->buf + start + 1,
|
||||
seq->count - start - 1);
|
||||
seq->count--;
|
||||
}
|
||||
|
||||
if (unlikely(seq_has_overflowed(seq)))
|
||||
return -EAGAIN;
|
||||
|
||||
if (seq->count == start)
|
||||
return 0;
|
||||
|
||||
/* skip leading comma */
|
||||
memmove(seq->buf + start, seq->buf + start + 1,
|
||||
seq->count - start - 1);
|
||||
seq->count--;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue