[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <20250708-wegrand-jungpflanze-a5940464908f@brauner>
Date: Tue, 8 Jul 2025 09:38:08 +0200
From: Christian Brauner <brauner@...nel.org>
To: Al Viro <viro@...iv.linux.org.uk>
Cc: Jens Axboe <axboe@...nel.dk>,
syzbot <syzbot+3de83a9efcca3f0412ee@...kaller.appspotmail.com>, jack@...e.cz, kees@...nel.org, linux-fsdevel@...r.kernel.org,
linux-kernel@...r.kernel.org, linux-mm@...ck.org, syzkaller-bugs@...glegroups.com,
Mike Rapoport <rppt@...nel.org>
Subject: Re: [PATCH] secretmem: use SB_I_NOEXEC
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.
Powered by blists - more mailing lists