[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <20251006-wachsen-zusendung-6cc31055eb75@brauner>
Date: Mon, 6 Oct 2025 12:47:50 +0200
From: Christian Brauner <brauner@...nel.org>
To: Kees Cook <kees@...nel.org>
Cc: syzbot <syzbot+a9391462075ffb9f77c6@...kaller.appspotmail.com>,
jack@...e.cz, linux-fsdevel@...r.kernel.org, linux-kernel@...r.kernel.org,
linux-mm@...ck.org, syzkaller-bugs@...glegroups.com, viro@...iv.linux.org.uk
Subject: Re: [syzbot] [fs?] [mm?] WARNING in path_noexec (2)
On Tue, Sep 30, 2025 at 03:04:22PM -0700, Kees Cook wrote:
> On Tue, Sep 30, 2025 at 01:17:34PM -0700, syzbot wrote:
> > Reported-by: syzbot+a9391462075ffb9f77c6@...kaller.appspotmail.com
> >
> > ------------[ cut here ]------------
> > WARNING: CPU: 1 PID: 6000 at fs/exec.c:119 path_noexec+0x1af/0x200 fs/exec.c:118
>
> Christian, this is:
>
> bool path_noexec(const struct path *path)
> {
> /* If it's an anonymous inode make sure that we catch any shenanigans. */
> VFS_WARN_ON_ONCE(IS_ANON_FILE(d_inode(path->dentry)) &&
> !(path->mnt->mnt_sb->s_iflags & SB_I_NOEXEC));
> return (path->mnt->mnt_flags & MNT_NOEXEC) ||
> (path->mnt->mnt_sb->s_iflags & SB_I_NOEXEC);
> }
>
> > C reproducer: https://syzkaller.appspot.com/x/repro.c?x=13e5fd6f980000
>
> I think is from the created fd_dma_buf. I expect this would fix it:
>
>
> diff --git a/drivers/dma-buf/dma-buf.c b/drivers/dma-buf/dma-buf.c
> index 2bcf9ceca997..6e2ab1a4560d 100644
> --- a/drivers/dma-buf/dma-buf.c
> +++ b/drivers/dma-buf/dma-buf.c
> @@ -189,6 +189,8 @@ static int dma_buf_fs_init_context(struct fs_context *fc)
> {
> struct pseudo_fs_context *ctx;
>
> + fc->s_iflags |= SB_I_NOEXEC;
> + fc->s_iflags |= SB_I_NODEV;
Yeah, that seems like a good thing to do.
I'm quite happy that the VFS_WARN_ON_ONCE() in there is catching all
this!
Do you want to send a real patch I can pick up?
> ctx = init_pseudo(fc, DMA_BUF_MAGIC);
> if (!ctx)
> return -ENOMEM;
>
>
> Which reminds me, this still isn't landed either for secretmem:
> https://lore.kernel.org/all/20250707171735.GE1880847@ZenIV/
It should be in mainline as:
commit 98f99394a104cc80296da34a62d4e1ad04127013 ("secretmem: use SB_I_NOEXEC")
Powered by blists - more mailing lists