From: Jeff Layton <jlayton@xxxxxxxxxx> commit 056d33137bf9364456ee70aa265ccbb948daee49 upstream. 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@xxxxxxxxxx> Link: https://lore.kernel.org/r/20241115-statmount-v2-2-cd29aeff9cbb@xxxxxxxxxx Signed-off-by: Christian Brauner <brauner@xxxxxxxxxx> Stable-dep-of: 5eb987105357 ("fs: fix adding security options to statmount.mnt_opt") Signed-off-by: Greg Kroah-Hartman <gregkh@xxxxxxxxxxxxxxxxxxx> --- fs/namespace.c | 4 ++++ 1 file changed, 4 insertions(+) --- a/fs/namespace.c +++ b/fs/namespace.c @@ -5042,6 +5042,10 @@ static int statmount_mnt_opts(struct kst 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; Patches currently in stable-queue which might be from jlayton@xxxxxxxxxx are queue-6.13/nfsd-encode-compound-operation-status-on-page-boundaries.patch queue-6.13/fs-prepend-statmount.mnt_opts-string-with-security_sb_mnt_opts.patch queue-6.13/statmount-let-unset-strings-be-empty.patch