<feed xmlns='http://www.w3.org/2005/Atom'>
<title>kernel.git/fs/nsfs.c, branch linux-6.15.y</title>
<subtitle>Hosts the 0x221E linux distro kernel.
</subtitle>
<id>https://git.0xinfinity.dev/distro/kernel.git/atom?h=linux-6.15.y</id>
<link rel='self' href='https://git.0xinfinity.dev/distro/kernel.git/atom?h=linux-6.15.y'/>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/'/>
<updated>2025-03-24T18:38:12Z</updated>
<entry>
<title>Merge tag 'vfs-6.15-rc1.nsfs' of git://git.kernel.org/pub/scm/linux/kernel/git/vfs/vfs</title>
<updated>2025-03-24T18:38:12Z</updated>
<author>
<name>Linus Torvalds</name>
</author>
<published>2025-03-24T18:38:12Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=74adf9e3538423256fe197bd235daa2b73c3af2c'/>
<id>urn:sha1:74adf9e3538423256fe197bd235daa2b73c3af2c</id>
<content type='text'>
Pull vfs nsfs updates from Christian Brauner:
 "This contains non-urgent fixes for nsfs to validate ioctls before
  performing any relevant operations.

  We alredy did this for a few other filesystems last cycle"

* tag 'vfs-6.15-rc1.nsfs' of git://git.kernel.org/pub/scm/linux/kernel/git/vfs/vfs:
  selftests/nsfs: add ioctl validation tests
  nsfs: validate ioctls
</content>
</entry>
<entry>
<title>nsfs: remove d_op-&gt;d_delete</title>
<updated>2025-02-24T10:30:35Z</updated>
<author>
<name>Christian Brauner</name>
</author>
<published>2025-02-24T10:30:35Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=425e3e3bd62c568a4365af0923d6ebad71a7dcfc'/>
<id>urn:sha1:425e3e3bd62c568a4365af0923d6ebad71a7dcfc</id>
<content type='text'>
Nsfs only deals with unhashed dentries and there's currently no way for
them to become hashed. So remove d_op-&gt;d_delete.

Signed-off-by: Christian Brauner &lt;brauner@kernel.org&gt;
</content>
</entry>
<entry>
<title>nsfs: validate ioctls</title>
<updated>2025-02-20T08:13:49Z</updated>
<author>
<name>Christian Brauner</name>
</author>
<published>2025-02-19T16:40:28Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=7fd511f8c911ab6ffb49357d5cd8ef493f28c921'/>
<id>urn:sha1:7fd511f8c911ab6ffb49357d5cd8ef493f28c921</id>
<content type='text'>
Nsfs supports extensible and non-extensible ioctls. Validate both types
to prevent confusion.

Link: https://lore.kernel.org/r/20250219-work-nsfs-v1-1-21128d73c5e8@kernel.org
Reviewed-by: Jeff Layton &lt;jlayton@kernel.org&gt;
Signed-off-by: Christian Brauner &lt;brauner@kernel.org&gt;
</content>
</entry>
<entry>
<title>fs: lockless mntns lookup for nsfs</title>
<updated>2025-01-09T15:58:52Z</updated>
<author>
<name>Christian Brauner</name>
</author>
<published>2024-12-12T23:03:44Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=4368898b271ad4ea3b6ae64f5cd16486a6d65430'/>
<id>urn:sha1:4368898b271ad4ea3b6ae64f5cd16486a6d65430</id>
<content type='text'>
We already made the rbtree lookup lockless for the simple lookup case.
However, walking the list of mount namespaces via nsfs still happens
with taking the read lock blocking concurrent additions of new mount
namespaces pointlessly. Plus, such additions are rare anyway so allow
lockless lookup of the previous and next mount namespace by keeping a
separate list. This also allows to make some things simpler in the code.

Link: https://lore.kernel.org/r/20241213-work-mount-rbtree-lockless-v3-5-6e3cdaf9b280@kernel.org
Reviewed-by: Jeff Layton &lt;jlayton@kernel.org&gt;
Suggested-by: Peter Zijlstra &lt;peterz@infradead.org&gt;
Signed-off-by: Christian Brauner &lt;brauner@kernel.org&gt;
</content>
</entry>
<entry>
<title>[tree-wide] finally take no_llseek out</title>
<updated>2024-09-27T15:18:43Z</updated>
<author>
<name>Al Viro</name>
</author>
<published>2024-09-27T01:56:11Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=cb787f4ac0c2e439ea8d7e6387b925f74576bdf8'/>
<id>urn:sha1:cb787f4ac0c2e439ea8d7e6387b925f74576bdf8</id>
<content type='text'>
no_llseek had been defined to NULL two years ago, in commit 868941b14441
("fs: remove no_llseek")

To quote that commit,

  At -rc1 we'll need do a mechanical removal of no_llseek -

  git grep -l -w no_llseek | grep -v porting.rst | while read i; do
	sed -i '/\&lt;no_llseek\&gt;/d' $i
  done

  would do it.

Unfortunately, that hadn't been done.  Linus, could you do that now, so
that we could finally put that thing to rest? All instances are of the
form
	.llseek = no_llseek,
so it's obviously safe.

Signed-off-by: Al Viro &lt;viro@zeniv.linux.org.uk&gt;
Signed-off-by: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
</content>
</entry>
<entry>
<title>nsfs: iterate through mount namespaces</title>
<updated>2024-08-09T10:46:59Z</updated>
<author>
<name>Christian Brauner</name>
</author>
<published>2024-07-19T11:41:52Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=a1d220d9dafa8d76ba60a784a1016c3134e6a1e8'/>
<id>urn:sha1:a1d220d9dafa8d76ba60a784a1016c3134e6a1e8</id>
<content type='text'>
It is already possible to list mounts in other mount namespaces and to
retrieve namespace file descriptors without having to go through procfs
by deriving them from pidfds.

Augment these abilities by adding the ability to retrieve information
about a mount namespace via NS_MNT_GET_INFO. This will return the mount
namespace id and the number of mounts currently in the mount namespace.
The number of mounts can be used to size the buffer that needs to be
used for listmount() and is in general useful without having to actually
iterate through all the mounts. The structure is extensible.

And add the ability to iterate through all mount namespaces over which
the caller holds privilege returning the file descriptor for the next or
previous mount namespace.

To retrieve a mount namespace the caller must be privileged wrt to it's
owning user namespace. This means that PID 1 on the host can list all
mounts in all mount namespaces or that a container can list all mounts
of its nested containers.

Optionally pass a structure for NS_MNT_GET_INFO with
NS_MNT_GET_{PREV,NEXT} to retrieve information about the mount namespace
in one go. Both ioctls can be implemented for other namespace types
easily.

Together with recent api additions this means one can iterate through
all mounts in all mount namespaces without ever touching procfs.

Link: https://lore.kernel.org/r/20240719-work-mount-namespace-v1-5-834113cab0d2@kernel.org
Reviewed-by: Josef Bacik &lt;josef@toxicpanda.com&gt;
Reviewed-by: Jeff Layton &lt;jlayton@kernel.org&gt;
Signed-off-by: Christian Brauner &lt;brauner@kernel.org&gt;
</content>
</entry>
<entry>
<title>nsfs: use cleanup guard</title>
<updated>2024-07-18T07:50:08Z</updated>
<author>
<name>Christian Brauner</name>
</author>
<published>2024-07-16T07:19:11Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=280e36f0d5b997173d014c07484c03a7f7750668'/>
<id>urn:sha1:280e36f0d5b997173d014c07484c03a7f7750668</id>
<content type='text'>
Ensure that rcu read lock is given up before returning.

Link: https://lore.kernel.org/r/20240716-elixier-fliesen-1ab342151a61@brauner
Fixes: ca567df74a28 ("nsfs: add pid translation ioctls")
Reported-by: syzbot+a3e82ae343b26b4d2335@syzkaller.appspotmail.com
Signed-off-by: Christian Brauner &lt;brauner@kernel.org&gt;
</content>
</entry>
<entry>
<title>Merge tag 'vfs-6.11.pidfs' of git://git.kernel.org/pub/scm/linux/kernel/git/vfs/vfs</title>
<updated>2024-07-15T19:34:01Z</updated>
<author>
<name>Linus Torvalds</name>
</author>
<published>2024-07-15T19:34:01Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=98f3a9a4fd449641010c77abca16aebb0b8d4419'/>
<id>urn:sha1:98f3a9a4fd449641010c77abca16aebb0b8d4419</id>
<content type='text'>
Pull pidfs updates from Christian Brauner:
 "This contains work to make it possible to derive namespace file
  descriptors from pidfd file descriptors.

  Right now it is already possible to use a pidfd with setns() to
  atomically change multiple namespaces at the same time. In other
  words, it is possible to switch to the namespace context of a process
  using a pidfd. There is no need to first open namespace file
  descriptors via procfs.

  The work included here is an extension of these abilities by allowing
  to open namespace file descriptors using a pidfd. This means it is now
  possible to interact with namespaces without ever touching procfs.

  To this end a new set of ioctls() on pidfds is introduced covering all
  supported namespace types"

* tag 'vfs-6.11.pidfs' of git://git.kernel.org/pub/scm/linux/kernel/git/vfs/vfs:
  pidfs: allow retrieval of namespace file descriptors
  nsfs: add open_namespace()
  nsproxy: add helper to go from arbitrary namespace to ns_common
  nsproxy: add a cleanup helper for nsproxy
  file: add take_fd() cleanup helper
</content>
</entry>
<entry>
<title>Merge tag 'vfs-6.11.nsfs' of git://git.kernel.org/pub/scm/linux/kernel/git/vfs/vfs</title>
<updated>2024-07-15T19:27:39Z</updated>
<author>
<name>Linus Torvalds</name>
</author>
<published>2024-07-15T19:27:39Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=1b074abe885f43b2c207b5e748ffa60604dbc020'/>
<id>urn:sha1:1b074abe885f43b2c207b5e748ffa60604dbc020</id>
<content type='text'>
Pull namespace-fs updates from Christian Brauner:
 "This adds ioctls allowing to translate PIDs between PID namespaces.

  The motivating use-case comes from LXCFS which is a tiny fuse
  filesystem used to virtualize various aspects of procfs. LXCFS is run
  on the host. The files and directories it creates can be bind-mounted
  by e.g. a container at startup and mounted over the various procfs
  files the container wishes to have virtualized.

  When e.g. a read request for uptime is received, LXCFS will receive
  the pid of the reader. In order to virtualize the corresponding read,
  LXCFS needs to know the pid of the init process of the reader's pid
  namespace.

  In order to do this, LXCFS first needs to fork() two helper processes.
  The first helper process setns() to the readers pid namespace. The
  second helper process is needed to create a process that is a proper
  member of the pid namespace.

  The second helper process then creates a ucred message with ucred.pid
  set to 1 and sends it back to LXCFS. The kernel will translate the
  ucred.pid field to the corresponding pid number in LXCFS's pid
  namespace. This way LXCFS can learn the init pid number of the
  reader's pid namespace and can go on to virtualize.

  Since these two forks() are costly LXCFS maintains an init pid cache
  that caches a given pid for a fixed amount of time. The cache is
  pruned during new read requests. However, even with the cache the hit
  of the two forks() is singificant when a very large number of
  containers are running.

  So this adds a simple set of ioctls that let's a caller translate PIDs
  from and into a given PID namespace. This significantly improves
  performance with a very simple change.

  To protect against races pidfds can be used to check whether the
  process is still valid"

* tag 'vfs-6.11.nsfs' of git://git.kernel.org/pub/scm/linux/kernel/git/vfs/vfs:
  nsfs: add pid translation ioctls
</content>
</entry>
<entry>
<title>nsfs: add open_namespace()</title>
<updated>2024-06-28T08:37:29Z</updated>
<author>
<name>Christian Brauner</name>
</author>
<published>2024-06-27T14:11:41Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=460695a294e63de4e4f30ad1679ffddeec932bb8'/>
<id>urn:sha1:460695a294e63de4e4f30ad1679ffddeec932bb8</id>
<content type='text'>
and call it from open_related_ns().

Link: https://lore.kernel.org/r/20240627-work-pidfs-v1-3-7e9ab6cc3bb1@kernel.org
Reviewed-by: Jeff Layton &lt;jlayton@kernel.org&gt;
Reviewed-by: Josef Bacik &lt;josef@toxicpanda.com&gt;
Reviewed-by: Alexander Mikhalitsyn &lt;aleksandr.mikhalitsyn@canonical.com&gt;
Signed-off-by: Christian Brauner &lt;brauner@kernel.org&gt;
</content>
</entry>
</feed>
