linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Al Viro <viro@zeniv.linux.org.uk>
To: Christian Brauner <brauner@kernel.org>
Cc: Jens Axboe <axboe@kernel.dk>,
	syzbot <syzbot+3de83a9efcca3f0412ee@syzkaller.appspotmail.com>,
	jack@suse.cz, kees@kernel.org, linux-fsdevel@vger.kernel.org,
	linux-kernel@vger.kernel.org, linux-mm@kvack.org,
	syzkaller-bugs@googlegroups.com, Mike Rapoport <rppt@kernel.org>
Subject: Re: [PATCH] secretmem: use SB_I_NOEXEC
Date: Mon, 7 Jul 2025 18:17:35 +0100	[thread overview]
Message-ID: <20250707171735.GE1880847@ZenIV> (raw)
In-Reply-To: <20250707-heimlaufen-hebamme-d6164bdc5f30@brauner>

On Mon, Jul 07, 2025 at 02:10:36PM +0200, Christian Brauner wrote:

>  static int secretmem_init_fs_context(struct fs_context *fc)
>  {
> -	return init_pseudo(fc, SECRETMEM_MAGIC) ? 0 : -ENOMEM;
> +	struct pseudo_fs_context *ctx;
> +
> +	ctx = init_pseudo(fc, SECRETMEM_MAGIC);
> +	if (!ctx)
> +		return -ENOMEM;
> +
> +	fc->s_iflags |= SB_I_NOEXEC;
> +	fc->s_iflags |= SB_I_NODEV;
> +	return 0;
>  }

What's the point of doing that *after* init_pseudo()?  IOW, why not simply

static int secretmem_init_fs_context(struct fs_context *fc)
{
	fc->s_iflags |= SB_I_NOEXEC;
	fc->s_iflags |= SB_I_NODEV;
	return init_pseudo(fc, SECRETMEM_MAGIC) ? 0 : -ENOMEM;
}

seeing that init_pseudo() won't undo those?


  parent reply	other threads:[~2025-07-07 17:17 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-07-07 11:02 [syzbot] [mm?] [fs?] WARNING in path_noexec syzbot
2025-07-07 11:30 ` Christian Brauner
2025-07-07 12:10   ` syzbot
2025-07-07 12:10   ` [PATCH] secretmem: use SB_I_NOEXEC Christian Brauner
2025-07-07 12:32     ` Mike Rapoport
2025-07-07 17:17     ` Al Viro [this message]
2025-07-08  7:38       ` Christian Brauner

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20250707171735.GE1880847@ZenIV \
    --to=viro@zeniv.linux.org.uk \
    --cc=axboe@kernel.dk \
    --cc=brauner@kernel.org \
    --cc=jack@suse.cz \
    --cc=kees@kernel.org \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=rppt@kernel.org \
    --cc=syzbot+3de83a9efcca3f0412ee@syzkaller.appspotmail.com \
    --cc=syzkaller-bugs@googlegroups.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox