From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=100.103.45.18 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1796300049; b=BgpdDQf0TQcukg+nwmjNUTWOGidfA/voQycW77ah2nS9IRRx0ng3ErVg5Ham/Pyva4tU xCBteHL4okV/NWXIh8eMJwL/oLYuvCb1cvXjgGs5SYrDVE6zLsYTkEeY0m53g6VK7YGSA UJ7MhGKYzrWsPbQ1xFnqggMZu4WVTC1ybvGf2GWacDemue9+Tk26YQlq7oWWE6qd9po8P rSUY/sxO5v3X3HVG4m5J8yAXBibIRhxtsUvQ5bjeanK6aGlTLRtudWNnw5F7RA2Pfb7Or 8WI+QXnsbR+e+Njmk7l8t1PmlIkHwiWoUfE75Z1dYGiSChM1dOik5aKrsW6x9x2Bhjw== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796300049; h=Received:DKIM-Signature:Date:From:To:Cc:Subject:Message-ID: References:MIME-Version:Content-Type:Content-Disposition: Content-Transfer-Encoding:In-Reply-To; bh=NiWLE7E3bd5qTA2K2Fd6tJtV648/Udkeas6y44B/LXg=; b=SRB0U7XHiuN0nL+llnmxyTkDpBOLxTbp0Yd4IZB76/8e3qllPHn8EYo68UuXdNASy+tD zPred/iUJQzhRYs4W/NH61pBoU0dPdl6q8M31mCoaEVfa6/508LCDbur01xw4Vre4tiog N9PXbSMtSmI4qzkwPs21RhTvOrz+Qm1cIxlwP+QlGuJspoO4uTjQJY7KfPM//l3AqPCSz y8vHOlLujhZGBF+GAPtxF4qbcAC3hlmaV9C3ao3BMOkL5/x/VjKBBPaZzLPAdKtbgRVVv aWycCjjPxUSrtgrif0rPzVLVg9b/35F4FPh2yZdIVDJ1vBOZvhupJb4ls9ORTcoAUkg== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=mmhNkEgT; arc=none smtp.remote-ip=100.103.45.18 Received: from smtp.kernel.org (quasi.space.kernel.org [100.103.45.18]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 341C3606BE99; Thu, 3 Dec 2026 12:14:08 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key, unprotected) header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=mmhNkEgT Received: by smtp.kernel.org (Postfix) with ESMTPSA id C1A451F00935; Thu, 3 Dec 2026 12:14:05 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1796300048; bh=NiWLE7E3bd5qTA2K2Fd6tJtV648/Udkeas6y44B/LXg=; h=Date:From:To:Cc:Subject:References:In-Reply-To; b=mmhNkEgTHc32z164HIYkQ844wONP+ztUrmp32sAiDz0M1DqTcZ2jEPiGLNe5ISR/D 9BBsoD63dXGLeT/9DO1sfNMpO1uBxXOf4IjYHbf1XgvQJJ7ZbMX5wan+4B7SS4lrCB Rj1+N4ybyngZWpktw+Rwsfn8lRMb3QM6kJ320IxeHuu/UBdvYSfUb4ydTGnpNDs0UW RzSB6GX4ndlL800mVV3OY/P6GO0H6S6DkSP5fEvqMTmzPl/BdRulg26B9BWDzV5i34 fwZ8EXTT5hf27UnGi/4dw4R0JrxPrHaBMeT9hNEcTdC4PI9QzsAyL0dC9UzjJKW+oE I7oco0Xcf+C+w== Date: Thu, 3 Dec 2026 12:14:02 +0000 From: "Lorenzo Stoakes (ARM)" To: Amir Goldstein Cc: Miklos Szeredi , Dominik Maier , "David Hildenbrand (Arm)" , Alexander Viro , Christian Brauner , Andrew Morton , "Liam R . Howlett" , 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 Message-ID: References: <20261203020416.3569911-1-dmnk@google.com> X-Mailing-List: linux-unionfs@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: 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) 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