Re: [PATCH] dma-buf: add SB_I_NOEXEC flag to dmabuf pseudo-filesystem

From: Cong Wang

Date: Thu Feb 05 2026 - 23:01:53 EST


On Sun, Feb 1, 2026 at 10:29 PM Christoph Hellwig <hch@xxxxxxxxxxxxx> wrote:
>
> On Sun, Feb 01, 2026 at 09:09:52AM -0800, Cong Wang wrote:
> > From: Cong Wang <cwang@xxxxxxxxxxxxxx>
> >
> > The dmabuf filesystem uses alloc_anon_inode() to create anonymous inodes
> > but does not set the SB_I_NOEXEC flag on its superblock. This triggers a
> > VFS warning in path_noexec() when userspace mmaps a dma-buf:
>
> As last time, I think it would be much preferable to set SB_I_NOEXEC and
> SB_I_NODEV by default in init_pseudo and just clear it if needed.
>
> I can't think of anything would need to clear them from a quick look.
>

I agree that setting SB_I_NOEXEC and SB_I_NODEV by default in
init_pseudo is a better approach.

I will send a v2 tomorrow.

Thanks,
Cong