Linux filesystem development
 help / color / mirror / Atom feed
From: "John Groves" <john@groves.net>
To: "Darrick J . Wong" <djwong@kernel.org>,
	"Gregory Price" <gourry@gourry.net>
Cc: "John Groves" <john@jagalactic.com>,
	"Miklos Szeredi" <miklos@szeredi.hu>,
	"Dan Williams" <djbw@kernel.org>,
	"Bernd Schubert" <bschubert@ddn.com>,
	"Alison Schofield" <alison.schofield@intel.com>,
	"John Groves (jgroves)" <jgroves@micron.com>,
	"Jonathan Corbet" <corbet@lwn.net>, "Jake Edge" <jake@lwn.net>,
	"Shuah Khan" <skhan@linuxfoundation.org>,
	"Vishal Verma" <vishal.l.verma@intel.com>,
	"Dave Jiang" <dave.jiang@intel.com>,
	"Matthew Wilcox" <willy@infradead.org>, "Jan Kara" <jack@suse.cz>,
	"Alexander Viro" <viro@zeniv.linux.org.uk>,
	"David Hildenbrand" <david@kernel.org>,
	"Christian Brauner" <brauner@kernel.org>,
	"Randy Dunlap" <rdunlap@infradead.org>,
	"Jeff Layton" <jlayton@kernel.org>,
	"Amir Goldstein" <amir73il@gmail.com>,
	"Jonathan Cameron" <jic23@kernel.org>,
	"Stefan Hajnoczi" <shajnocz@redhat.com>,
	"Joanne Koong" <joannelkoong@gmail.com>,
	"Josef Bacik" <josef@toxicpanda.com>,
	"Bagas Sanjaya" <bagasdotme@gmail.com>,
	"Chen Linxuan" <chenlinxuan@uniontech.com>,
	"James Morse" <james.morse@arm.com>,
	"Fuad Tabba" <tabba@google.com>,
	"Sean Christopherson" <seanjc@google.com>,
	"Shivank Garg" <shivankg@amd.com>,
	"Ackerley Tng" <ackerleytng@google.com>,
	"Andrew Morton" <akpm@linux-foundation.org>,
	"Namjae Jeon" <linkinjeon@kernel.org>,
	"Lorenzo Stoakes" <ljs@kernel.org>,
	"Greg Kroah-Hartman" <gregkh@linuxfoundation.org>,
	"Ira Weiny" <iweiny@kernel.org>,
	"Pasha Tatashin" <pasha.tatashin@soleen.com>,
	"Haren Myneni" <haren@linux.ibm.com>,
	"Pratyush Yadav" <pratyush@kernel.org>,
	"Giovanni Cabiddu" <giovanni.cabiddu@intel.com>,
	"Jiri Slaby" <jirislaby@kernel.org>,
	"Ethan Nelson-Moore" <enelsonmoore@gmail.com>,
	"Gabriel Whigham" <gabewhigham@gmail.com>,
	"Aravind Ramesh" <arramesh@micron.com>,
	"Ajay Joshi" <ajayjoshi@micron.com>,
	"venkataravis@micron.com" <venkataravis@micron.com>,
	"linux-doc@vger.kernel.org" <linux-doc@vger.kernel.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	"nvdimm@lists.linux.dev" <nvdimm@lists.linux.dev>,
	"linux-cxl@vger.kernel.org" <linux-cxl@vger.kernel.org>,
	"linux-fsdevel@vger.kernel.org" <linux-fsdevel@vger.kernel.org>,
	"fuse-devel@lists.linux.dev" <fuse-devel@lists.linux.dev>
Subject: Re: [PATCH v13 10/12] famfs: Add runtime operation-permission (opts) framework
Date: Sat, 22 Aug 2026 16:57:22 -0500	[thread overview]
Message-ID: <de0be5a5-d171-4032-b162-c7bd9b95220e@app.fastmail.com> (raw)
In-Reply-To: <20260822174029.GC6110@frogsfrogsfrogs>



On Sat, Aug 22, 2026, at 12:40 PM, Darrick J. Wong wrote:
> On Sat, Aug 22, 2026 at 12:18:58AM -0400, Gregory Price wrote:
> > On Fri, Aug 21, 2026 at 05:07:28PM -0700, Darrick J. Wong wrote:
> > > 
> > > But what prevents a malicious program that is /not/ the famfs client
> > > software but has CAP_SYS_ADMIN from doing that?
> > > 
> > 
> > Such a program can already unmount famfs, rebind the device to
> > device_dax, and mmap the whole range directly. MAP_CREATE isn't
> > handing it reach it didn't have. 

Gregory is right, but also: this is possible with fuse too, since the log
needs to be played into a tree that the fuse server consumes - in order
to avoid searching the log (order n) on every lookup. 

> 
> Thinking about this a little more -- some random root process that
> accidentally tries to create/modify a directory tree on a famfs mount
> will just end up with fmap-less files that won't work for IO or
> mmapping.  That's dorky, but I think you're right that it's no big deal.

I've had users do that, and yes it's dorky but NBD.  It can be locked
down tighter by turning off FAMFS_OPT_CREATE except during 
log play etc., but the main thing is "don't do that: it won't harm the 
system, but it also it won't do what you want".

'famfs fsck' finds those, and the famfs cli can clean them up.

> 
> 
> A bigger question I just thought of is sharing cxlmem between files (aka
> reflink).  Is that allowed?  I could see a theoretical usecase for
> programs A and B wanting to share some cxlmem for communication or
> heartbeats whilst having their own /a and /b files for their private
> memory.  Probably you'd just create a /common file to do that and not
> map the same cxlmem page into /a and /b, right?

Famfs doesn't support reflinks - I don't think there's a use case.

There is a pcq.c and libpcq.c in the famfs user space specifically for
using file pairs as producer/consumer queues - one file contains the
fields written by the producer, the other contains the fields written
by the consumer. This use case works great, but without cache-coherent
cxl memory (which is coming but not here yet AFAIK) libpcq has to verify
message sequence numbers and checksums to avoid reading messages 
from stale cache lines (i.e. loaded before valid).

I do have CI that creates cross linked files, which are detected by 
'famfs fsck'. 

> 
> But having said that, the fsdax code /can/ support sharing between
> files, so I wonder if famfs is prepared either (a) to enable that
> sharing or (b) reject a mapping that would overlap with an existing
> mapping?  Things will go very badly in the kernel if famfs doesn't set
> up the dax_folio state correctly.
> 
> --D
> 

Last I checked, if cross linked files get created (as test_errors.sh in my
smoke test suite does), you trigger a WARN_ONCE from dax,
but otherwise it does no harm to the system.

Thanks,
John


  reply	other threads:[~2026-08-22 21:57 UTC|newest]

Thread overview: 25+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <20260810202325.96202-1-john@jagalactic.com>
2026-08-10 20:23 ` [PATCH v13 00/12] famfs: the Fabric-Attached Memory File System (standalone) John Groves
2026-08-10 20:24   ` [PATCH v13 01/12] dax: replace exported dax_dev_get() with non-allocating dax_dev_find() John Groves
2026-08-10 20:24   ` [PATCH v13 02/12] famfs: Module operations, fs_context, and mount John Groves
2026-08-10 20:24   ` [PATCH v13 03/12] famfs: Add daxdev table and dax notify_failure support John Groves
2026-08-10 20:24   ` [PATCH v13 04/12] famfs: Introduce inode_operations and super_operations John Groves
2026-08-10 20:24   ` [PATCH v13 05/12] famfs: Introduce file_operations read/write John Groves
2026-08-10 20:25   ` [PATCH v13 06/12] famfs: Introduce mmap and VM fault handling John Groves
2026-08-10 20:25   ` [PATCH v13 07/12] famfs: MAP_CREATE ioctl and fmap ingest (ABI 44) John Groves
2026-08-11  8:03     ` Richard Cheng
2026-08-11 22:17       ` John Groves
2026-08-22  0:17         ` Darrick J. Wong
2026-08-22 19:23           ` John Groves
2026-08-10 20:25   ` [PATCH v13 08/12] famfs: iomap_begin and file-to-dax offset resolution John Groves
2026-08-10 20:25   ` [PATCH v13 09/12] famfs: Register secondary daxdevs by path (FAMFSIOC_DAXDEV_OPEN) John Groves
2026-08-10 20:25   ` [PATCH v13 10/12] famfs: Add runtime operation-permission (opts) framework John Groves
2026-08-22  0:07     ` Darrick J. Wong
2026-08-22  4:18       ` Gregory Price
2026-08-22 17:40         ` Darrick J. Wong
2026-08-22 21:57           ` John Groves [this message]
2026-08-23 16:43           ` Gregory Price
2026-08-23 16:57             ` Gregory Price
2026-08-10 20:25   ` [PATCH v13 11/12] famfs: Report device capacity via statfs so df works John Groves
2026-08-10 20:26   ` [PATCH v13 12/12] famfs: Add documentation John Groves
2026-08-20 12:37   ` [PATCH v13 00/12] famfs: the Fabric-Attached Memory File System (standalone) Jeff Layton
2026-08-22  0:19     ` Darrick J. Wong

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=de0be5a5-d171-4032-b162-c7bd9b95220e@app.fastmail.com \
    --to=john@groves.net \
    --cc=ackerleytng@google.com \
    --cc=ajayjoshi@micron.com \
    --cc=akpm@linux-foundation.org \
    --cc=alison.schofield@intel.com \
    --cc=amir73il@gmail.com \
    --cc=arramesh@micron.com \
    --cc=bagasdotme@gmail.com \
    --cc=brauner@kernel.org \
    --cc=bschubert@ddn.com \
    --cc=chenlinxuan@uniontech.com \
    --cc=corbet@lwn.net \
    --cc=dave.jiang@intel.com \
    --cc=david@kernel.org \
    --cc=djbw@kernel.org \
    --cc=djwong@kernel.org \
    --cc=enelsonmoore@gmail.com \
    --cc=fuse-devel@lists.linux.dev \
    --cc=gabewhigham@gmail.com \
    --cc=giovanni.cabiddu@intel.com \
    --cc=gourry@gourry.net \
    --cc=gregkh@linuxfoundation.org \
    --cc=haren@linux.ibm.com \
    --cc=iweiny@kernel.org \
    --cc=jack@suse.cz \
    --cc=jake@lwn.net \
    --cc=james.morse@arm.com \
    --cc=jgroves@micron.com \
    --cc=jic23@kernel.org \
    --cc=jirislaby@kernel.org \
    --cc=jlayton@kernel.org \
    --cc=joannelkoong@gmail.com \
    --cc=john@jagalactic.com \
    --cc=josef@toxicpanda.com \
    --cc=linkinjeon@kernel.org \
    --cc=linux-cxl@vger.kernel.org \
    --cc=linux-doc@vger.kernel.org \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=ljs@kernel.org \
    --cc=miklos@szeredi.hu \
    --cc=nvdimm@lists.linux.dev \
    --cc=pasha.tatashin@soleen.com \
    --cc=pratyush@kernel.org \
    --cc=rdunlap@infradead.org \
    --cc=seanjc@google.com \
    --cc=shajnocz@redhat.com \
    --cc=shivankg@amd.com \
    --cc=skhan@linuxfoundation.org \
    --cc=tabba@google.com \
    --cc=venkataravis@micron.com \
    --cc=viro@zeniv.linux.org.uk \
    --cc=vishal.l.verma@intel.com \
    --cc=willy@infradead.org \
    /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