From: Christian Brauner <brauner@kernel.org>
To: Al Viro <viro@zeniv.linux.org.uk>
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: Tue, 8 Jul 2025 09:38:08 +0200 [thread overview]
Message-ID: <20250708-wegrand-jungpflanze-a5940464908f@brauner> (raw)
In-Reply-To: <20250707171735.GE1880847@ZenIV>
On Mon, Jul 07, 2025 at 06:17:35PM +0100, Al Viro wrote:
> 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?
Seemed cleaner to do it the other way around and get rid of the ? while
at it. I don't think it matters either way.
prev parent reply other threads:[~2025-07-08 7:38 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
2025-07-08 7:38 ` Christian Brauner [this message]
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=20250708-wegrand-jungpflanze-a5940464908f@brauner \
--to=brauner@kernel.org \
--cc=axboe@kernel.dk \
--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 \
--cc=viro@zeniv.linux.org.uk \
/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