linux/fs
Linus Torvalds 18b19abc37 namespace-6.18-rc1
-----BEGIN PGP SIGNATURE-----
 
 iHUEABYKAB0WIQRAhzRXHqcMeLMyaSiRxhvAZXjcogUCaNZQgQAKCRCRxhvAZXjc
 oiFXAQCpbLvkWbld9wLgxUBhq+q+kw5NvGxzpvqIhXwJB9F9YAEA44/Wevln4xGx
 +kRUbP+xlRQqenIYs2dLzVHzAwAdfQ4=
 =EO4Y
 -----END PGP SIGNATURE-----

Merge tag 'namespace-6.18-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/vfs/vfs

Pull namespace updates from Christian Brauner:
 "This contains a larger set of changes around the generic namespace
  infrastructure of the kernel.

  Each specific namespace type (net, cgroup, mnt, ...) embedds a struct
  ns_common which carries the reference count of the namespace and so
  on.

  We open-coded and cargo-culted so many quirks for each namespace type
  that it just wasn't scalable anymore. So given there's a bunch of new
  changes coming in that area I've started cleaning all of this up.

  The core change is to make it possible to correctly initialize every
  namespace uniformly and derive the correct initialization settings
  from the type of the namespace such as namespace operations, namespace
  type and so on. This leaves the new ns_common_init() function with a
  single parameter which is the specific namespace type which derives
  the correct parameters statically. This also means the compiler will
  yell as soon as someone does something remotely fishy.

  The ns_common_init() addition also allows us to remove ns_alloc_inum()
  and drops any special-casing of the initial network namespace in the
  network namespace initialization code that Linus complained about.

  Another part is reworking the reference counting. The reference
  counting was open-coded and copy-pasted for each namespace type even
  though they all followed the same rules. This also removes all open
  accesses to the reference count and makes it private and only uses a
  very small set of dedicated helpers to manipulate them just like we do
  for e.g., files.

  In addition this generalizes the mount namespace iteration
  infrastructure introduced a few cycles ago. As reminder, the vfs makes
  it possible to iterate sequentially and bidirectionally through all
  mount namespaces on the system or all mount namespaces that the caller
  holds privilege over. This allow userspace to iterate over all mounts
  in all mount namespaces using the listmount() and statmount() system
  call.

  Each mount namespace has a unique identifier for the lifetime of the
  systems that is exposed to userspace. The network namespace also has a
  unique identifier working exactly the same way. This extends the
  concept to all other namespace types.

  The new nstree type makes it possible to lookup namespaces purely by
  their identifier and to walk the namespace list sequentially and
  bidirectionally for all namespace types, allowing userspace to iterate
  through all namespaces. Looking up namespaces in the namespace tree
  works completely locklessly.

  This also means we can move the mount namespace onto the generic
  infrastructure and remove a bunch of code and members from struct
  mnt_namespace itself.

  There's a bunch of stuff coming on top of this in the future but for
  now this uses the generic namespace tree to extend a concept
  introduced first for pidfs a few cycles ago. For a while now we have
  supported pidfs file handles for pidfds. This has proven to be very
  useful.

  This extends the concept to cover namespaces as well. It is possible
  to encode and decode namespace file handles using the common
  name_to_handle_at() and open_by_handle_at() apis.

  As with pidfs file handles, namespace file handles are exhaustive,
  meaning it is not required to actually hold a reference to nsfs in
  able to decode aka open_by_handle_at() a namespace file handle.
  Instead the FD_NSFS_ROOT constant can be passed which will let the
  kernel grab a reference to the root of nsfs internally and thus decode
  the file handle.

  Namespaces file descriptors can already be derived from pidfds which
  means they aren't subject to overmount protection bugs. IOW, it's
  irrelevant if the caller would not have access to an appropriate
  /proc/<pid>/ns/ directory as they could always just derive the
  namespace based on a pidfd already.

  It has the same advantage as pidfds. It's possible to reliably and for
  the lifetime of the system refer to a namespace without pinning any
  resources and to compare them trivially.

  Permission checking is kept simple. If the caller is located in the
  namespace the file handle refers to they are able to open it otherwise
  they must hold privilege over the owning namespace of the relevant
  namespace.

  The namespace file handle layout is exposed as uapi and has a stable
  and extensible format. For now it simply contains the namespace
  identifier, the namespace type, and the inode number. The stable
  format means that userspace may construct its own namespace file
  handles without going through name_to_handle_at() as they are already
  allowed for pidfs and cgroup file handles"

* tag 'namespace-6.18-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/vfs/vfs: (65 commits)
  ns: drop assert
  ns: move ns type into struct ns_common
  nstree: make struct ns_tree private
  ns: add ns_debug()
  ns: simplify ns_common_init() further
  cgroup: add missing ns_common include
  ns: use inode initializer for initial namespaces
  selftests/namespaces: verify initial namespace inode numbers
  ns: rename to __ns_ref
  nsfs: port to ns_ref_*() helpers
  net: port to ns_ref_*() helpers
  uts: port to ns_ref_*() helpers
  ipv4: use check_net()
  net: use check_net()
  net-sysfs: use check_net()
  user: port to ns_ref_*() helpers
  time: port to ns_ref_*() helpers
  pid: port to ns_ref_*() helpers
  ipc: port to ns_ref_*() helpers
  cgroup: port to ns_ref_*() helpers
  ...
2025-09-29 11:20:29 -07:00
..
9p fs: rename generic_delete_inode() and generic_drop_inode() 2025-09-15 16:09:42 +02:00
adfs vfs-6.17-rc1.mmap_prepare 2025-07-28 13:43:25 -07:00
affs vfs-6.17-rc1.mmap_prepare 2025-07-28 13:43:25 -07:00
afs vfs-6.18-rc1.afs 2025-09-29 10:53:22 -07:00
autofs new helper: set_default_d_op() 2025-06-10 22:21:16 -04:00
bcachefs fs: WQ_PERCPU added to alloc_workqueue users 2025-09-19 16:15:07 +02:00
befs
bfs vfs-6.17-rc1.mmap_prepare 2025-07-28 13:43:25 -07:00
btrfs vfs-6.18-rc1.workqueue 2025-09-29 10:27:17 -07:00
cachefiles vfs-6.17-rc1.misc 2025-07-28 11:22:56 -07:00
ceph vfs-6.18-rc1.workqueue 2025-09-29 10:27:17 -07:00
coda vfs-6.17-rc1.mmap_prepare 2025-07-28 13:43:25 -07:00
configfs fs: rename generic_delete_inode() and generic_drop_inode() 2025-09-15 16:09:42 +02:00
cramfs cramfs: Verify inode mode when loading from disk 2025-09-01 13:13:10 +02:00
crypto fscrypt: add support for info in fs-specific part of inode 2025-08-21 13:58:07 +02:00
debugfs debugfs: fix mount options not being applied 2025-08-19 13:11:29 +02:00
devpts devpts, sunrpc, hostfs: don't bother with ->d_op 2025-06-11 13:40:04 -04:00
dlm fs: WQ_PERCPU added to alloc_workqueue users 2025-09-19 16:15:07 +02:00
ecryptfs vfs-6.17-rc1.fileattr 2025-07-28 15:24:14 -07:00
efivarfs vfs-6.18-rc1.misc 2025-09-29 09:03:07 -07:00
efs
erofs erofs: fix long xattr name prefix placement 2025-09-12 03:37:07 +08:00
exfat exfat: add cluster chain loop check for dir 2025-08-01 08:34:23 +09:00
exportfs exportfs: use lookup_one_unlocked() 2025-06-11 13:44:15 +02:00
ext2 \n 2025-07-28 16:16:09 -07:00
ext4 vfs-6.18-rc1.workqueue 2025-09-29 10:27:17 -07:00
f2fs vfs-6.18-rc1.inode 2025-09-29 09:42:30 -07:00
fat Significant patch series in this pull request: 2025-08-03 16:23:09 -07:00
freevxfs
fuse vfs-6.18-rc1.workqueue 2025-09-29 10:27:17 -07:00
gfs2 vfs-6.18-rc1.workqueue 2025-09-29 10:27:17 -07:00
hfs hfs/hfsplus updates for v6.17 2025-07-28 16:17:44 -07:00
hfsplus hfs/hfsplus updates for v6.17 2025-07-28 16:17:44 -07:00
hostfs fs: rename generic_delete_inode() and generic_drop_inode() 2025-09-15 16:09:42 +02:00
hpfs fs: add an icount_read helper 2025-09-01 12:41:09 +02:00
hugetlbfs mm/hugetlb: fix folio is still mapped when deleted 2025-09-25 16:10:34 -07:00
iomap vfs-6.18-rc1.iomap 2025-09-29 09:52:14 -07:00
isofs Current exclusion rules for ->d_flags stores are rather unpleasant. 2025-07-28 09:17:57 -07:00
jbd2 jbd2: prevent softlockup in jbd2_log_do_checkpoint() 2025-08-13 14:24:14 -04:00
jffs2 vfs-6.17-rc1.mmap_prepare 2025-07-28 13:43:25 -07:00
jfs Fixes and cleanups for JFS filesystem 2025-07-31 10:27:11 -07:00
kernfs vfs-6.18-rc1.misc 2025-09-29 09:03:07 -07:00
lockd
minix minixfs: Verify inode mode when loading from disk 2025-08-19 13:30:46 +02:00
netfs vfs-6.18-rc1.workqueue 2025-09-29 10:27:17 -07:00
nfs vfs-6.18-rc1.workqueue 2025-09-29 10:27:17 -07:00
nfs_common NFS/localio: nfs_uuid_put() fix the wake up after unlinking the file 2025-08-05 16:45:40 -07:00
nfsd vfs-6.18-rc1.workqueue 2025-09-29 10:27:17 -07:00
nilfs2 nilfs2: fix CFI failure when accessing /sys/fs/nilfs2/features/* 2025-09-13 13:05:38 -07:00
nls
notify vfs-6.18-rc1.workqueue 2025-09-29 10:27:17 -07:00
ntfs3 vfs-6.17-rc1.mmap_prepare 2025-07-28 13:43:25 -07:00
ocfs2 vfs-6.18-rc1.workqueue 2025-09-29 10:27:17 -07:00
omfs vfs-6.17-rc1.mmap_prepare 2025-07-28 13:43:25 -07:00
openpromfs
orangefs fs: rename generic_delete_inode() and generic_drop_inode() 2025-09-15 16:09:42 +02:00
overlayfs vfs-6.18-rc1.misc 2025-09-29 09:03:07 -07:00
proc namespace-6.18-rc1 2025-09-29 11:20:29 -07:00
pstore fs: rename generic_delete_inode() and generic_drop_inode() 2025-09-15 16:09:42 +02:00
qnx4
qnx6
quota fs: replace use of system_unbound_wq with system_dfl_wq 2025-09-19 16:15:07 +02:00
ramfs fs: rename generic_delete_inode() and generic_drop_inode() 2025-09-15 16:09:42 +02:00
resctrl fs/resctrl: Eliminate false positive lockdep warning when reading SNC counters 2025-09-09 12:43:36 +02:00
romfs fs: replace mmap hook with .mmap_prepare for simple mappings 2025-06-19 13:56:59 +02:00
smb vfs-6.18-rc1.workqueue 2025-09-29 10:27:17 -07:00
squashfs squashfs: fix memory leak in squashfs_fill_super 2025-08-19 16:35:53 -07:00
sysfs sysfs: constify internal references to 'struct bin_attribute' 2025-06-17 10:44:09 +02:00
tests
tracefs Massage rpc_pipefs to use saner primitives and clean up the 2025-07-28 09:56:09 -07:00
ubifs vfs-6.18-rc1.inode 2025-09-29 09:42:30 -07:00
udf \n 2025-07-28 16:16:09 -07:00
ufs vfs-6.17-rc1.mmap_prepare 2025-07-28 13:43:25 -07:00
unicode
vboxsf vfs-6.17-rc1.mmap_prepare 2025-07-28 13:43:25 -07:00
verity vfs-6.18-rc1.workqueue 2025-09-29 10:27:17 -07:00
xfs vfs-6.18-rc1.workqueue 2025-09-29 10:27:17 -07:00
zonefs zonefs changes for 6.17-rc1 2025-07-28 17:06:51 -07:00
aio.c fs: replace use of system_wq with system_percpu_wq 2025-09-19 16:15:07 +02:00
anon_inodes.c module: Rename EXPORT_SYMBOL_GPL_FOR_MODULES to EXPORT_SYMBOL_FOR_MODULES 2025-08-11 16:16:36 +02:00
attr.c docs/vfs: update references to i_mutex to i_rwsem 2025-06-23 12:17:33 +02:00
backing-file.c vfs-6.17-rc1.mmap_prepare 2025-07-28 13:43:25 -07:00
bad_inode.c
binfmt_elf.c execve updates for v6.17 2025-07-28 17:11:40 -07:00
binfmt_elf_fdpic.c execve updates for v6.17 2025-07-28 17:11:40 -07:00
binfmt_flat.c
binfmt_misc.c binfmt_misc: switch to locked_recursive_removal() 2025-07-02 22:36:51 -04:00
binfmt_script.c
bpf_fs_kfuncs.c bpf: Introduce bpf_cgroup_read_xattr to read xattr of cgroup's node 2025-07-02 14:18:20 +02:00
buffer.c fs/buffer: fix use-after-free when call bh_read() helper 2025-08-19 13:51:28 +02:00
char_dev.c
compat_binfmt_elf.c
coredump.c vfs-6.18-rc1.workqueue 2025-09-29 10:27:17 -07:00
d_path.c fold fs_struct->{lock,seq} into a seqlock 2025-07-08 10:25:19 +02:00
dax.c fs/dax: Reject IOCB_ATOMIC in dax_iomap_rw() 2025-08-11 14:03:38 +02:00
dcache.c vfs-6.18-rc1.afs 2025-09-29 10:53:22 -07:00
direct-io.c Summary of significant series in this pull request: 2025-07-31 14:57:54 -07:00
drop_caches.c
eventfd.c
eventpoll.c eventpoll: Replace rwlock with spinlock 2025-09-05 15:51:24 +02:00
exec.c coredump: don't pointlessly check and spew warnings 2025-08-21 13:54:40 +02:00
fcntl.c fcntl: trim arguments 2025-09-26 10:21:23 +02:00
fhandle.c namespace-6.18-rc1 2025-09-29 11:20:29 -07:00
file.c fs: always return zero on success from replace_fd() 2025-08-11 14:52:25 +02:00
file_attr.c fs: tighten a sanity check in file_attr_to_fileattr() 2025-07-16 10:22:01 +02:00
file_table.c \n 2025-07-31 10:31:00 -07:00
filesystems.c
fs-writeback.c vfs-6.18-rc1.workqueue 2025-09-29 10:27:17 -07:00
fs_context.c
fs_parser.c
fs_pin.c
fs_struct.c fold fs_struct->{lock,seq} into a seqlock 2025-07-08 10:25:19 +02:00
fs_types.c
fsopen.c fscontext: do not consume log entries when returning -EMSGSIZE 2025-08-11 14:52:41 +02:00
init.c
inode.c vfs-6.18-rc1.inode 2025-09-29 09:42:30 -07:00
internal.h nsfs: support exhaustive file handles 2025-09-19 14:26:16 +02:00
ioctl.c fs: remove vfs_ioctl export 2025-09-01 13:08:01 +02:00
Kconfig fs/Kconfig: enable HUGETLBFS only if ARCH_SUPPORTS_HUGETLBFS 2025-07-24 19:12:38 -07:00
Kconfig.binfmt
kernel_read_file.c
libfs.c vfs-6.17-rc1.pidfs 2025-07-28 14:10:15 -07:00
locks.c locks: Remove the last reference to EXPORT_OP_ASYNC_LOCK. 2025-08-11 14:52:24 +02:00
Makefile fs: split fileattr related helpers into separate file 2025-07-01 22:44:22 +02:00
mbcache.c
mnt_idmapping.c
mount.h mnt: port to ns_ref_*() helpers 2025-09-19 16:22:36 +02:00
mpage.c
namei.c openat2: don't trigger automounts with RESOLVE_NO_XDEV 2025-09-02 10:40:43 +02:00
namespace.c namespace-6.18-rc1 2025-09-29 11:20:29 -07:00
nsfs.c ns: move ns type into struct ns_common 2025-09-25 09:23:54 +02:00
open.c \n 2025-07-31 10:31:00 -07:00
pidfs.c namespace-6.18-rc1 2025-09-29 11:20:29 -07:00
pipe.c Add RWF_NOSIGNAL flag for pwritev2 2025-08-29 15:08:07 +02:00
pnode.c change_mnt_propagation(): calculate propagation source only if we'll need it 2025-08-19 12:05:59 -04:00
pnode.h get rid of CL_SHARE_TO_SLAVE 2025-06-29 19:03:46 -04:00
posix_acl.c
proc_namespace.c
read_write.c copy_file_range: limit size if in compat mode 2025-08-15 16:11:47 +02:00
readdir.c
remap_range.c
select.c fs: annotate suspected data race between poll_schedule_timeout() and pollwake() 2025-06-23 12:36:51 +02:00
seq_file.c
signalfd.c
splice.c netfs: Fix unbuffered write error handling 2025-08-15 15:56:49 +02:00
stack.c docs/vfs: update references to i_mutex to i_rwsem 2025-06-23 12:17:33 +02:00
stat.c
statfs.c
super.c vfs-6.18-rc1.workqueue 2025-09-29 10:27:17 -07:00
sync.c
sysctls.c
timerfd.c
userfaultfd.c mm/mremap: use an explicit uffd failure path for mremap 2025-07-24 19:12:29 -07:00
utimes.c
xattr.c vfs-6.17-rc1.misc 2025-07-28 11:22:56 -07:00