Linux filesystem development
 help / color / mirror / Atom feed
From: "Lorenzo Stoakes (ARM)" <ljs@kernel.org>
To: Amir Goldstein <amir73il@gmail.com>
Cc: Miklos Szeredi <miklos@szeredi.hu>,
	Dominik Maier <dmnk@google.com>,
	 "David Hildenbrand (Arm)" <david@kernel.org>,
	Alexander Viro <viro@zeniv.linux.org.uk>,
	 Christian Brauner <brauner@kernel.org>,
	Andrew Morton <akpm@linux-foundation.org>,
	 "Liam R . Howlett" <liam@infradead.org>,
	linux-fsdevel@vger.kernel.org, linux-unionfs@vger.kernel.org,
	 linux-mm@kvack.org, dmnk+artist@google.com
Subject: Re: [PATCH] backing-file: enforce write seals and writable mapping in mmap
Date: Thu, 3 Dec 2026 12:14:02 +0000	[thread overview]
Message-ID: <axFcxdl_PG4kGvWG@gremlin> (raw)
In-Reply-To: <CAOQ4uxgYLa1=HB2kM9L_6eMNARrqp53eRZ4=m+kJdgYbw3ObKQ@mail.gmail.com>

On Thu, Dec 03, 2026 at 11:16:45AM +0100, Amir Goldstein wrote:
> On Thu, Dec 3, 2026 at 10:16 AM Lorenzo Stoakes (ARM) <ljs@kernel.org> wrote:
> >
> > On Thu, Dec 03, 2026 at 09:33:34AM +0100, David Hildenbrand (Arm) wrote:
> > > On 12/3/26 03:04, Dominik Maier wrote:
> > > > do_mmap() and mmap_region() check memfd write seals, FMODE_WRITE, and
> > > > mapping_map_writable() on the outer file before calling ->mmap(). When
> > > > backing_file_mmap() switches vma->vm_file onto a backing file,
> > >
> > > Ehm, what?
> > >
> > > Lorenzo am I daydreaming or is that completely shaky?
> >
> > Yeah sorry Dominik, this is making changes to core incorrectly, mixing and
> > matching a bunch of things.
> >
> > The problem does seem genuine and local claude confirms that, but it needs a
> > significant rework.
> >
> > Given workload the simplest thing is for me to take this over and address all
>
> Lorenzo,
>
> Do feel free to address anything you feel like in mm, but fwiw,
> I believe the simplest thing is to not allow this from the start.
> Dominic, please verify the attached patch.

Oh perfect, this would be far more preferable thanks!

This patch did strike me as fixing the issue in the wrong place.

So if we could just get fuse to not even possibly do the wrong thing then this
resolves things beautifully :)

>
> Note that Christian has already queued a similar patch for banning
> pseudo fs passthrough files [1].

Lovely!

>
> Miklos, do you concur?
>
> Thanks,
> Amir.
>
> P.S. I intentionally placed the gate outside the S_IFMT switch
> to future-proof non-regular passthrough file types.
>
> [1] https://lore.kernel.org/linux-fsdevel/20261110-work-loop-pseudo-v1-38-4c998976c6c7@kernel.org/


--
Cheers, Lorenzo

      reply	other threads:[~2026-12-03 12:14 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-12-03  2:04 [PATCH] backing-file: enforce write seals and writable mapping in mmap Dominik Maier
2026-12-03  8:33 ` David Hildenbrand (Arm)
2026-12-03  9:16   ` Lorenzo Stoakes (ARM)
2026-12-03 10:16     ` Amir Goldstein
2026-12-03 12:14       ` Lorenzo Stoakes (ARM) [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=axFcxdl_PG4kGvWG@gremlin \
    --to=ljs@kernel.org \
    --cc=akpm@linux-foundation.org \
    --cc=amir73il@gmail.com \
    --cc=brauner@kernel.org \
    --cc=david@kernel.org \
    --cc=dmnk+artist@google.com \
    --cc=dmnk@google.com \
    --cc=liam@infradead.org \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=linux-unionfs@vger.kernel.org \
    --cc=miklos@szeredi.hu \
    --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