linux/tools/testing/selftests
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
..
acct
alsa selftests: ALSA: fix memory leak in utimer test 2025-07-31 17:01:53 +02:00
amd-pstate
arm64 kselftest/arm64: Don't open code SVE_PT_SIZE() in fp-ptrace 2025-08-30 11:31:11 +01:00
bpf selftests/bpf: Skip timer cases when bpf_timer is not supported 2025-09-10 12:34:09 -07:00
breakpoints selftests: breakpoints: use suspend_stats to reliably check suspend success 2025-07-10 14:21:30 -06:00
cachestat selftests: cachestat: add tests for mmap, refactor and enhance mmap test for cachestat validation 2025-08-02 12:06:09 -07:00
capabilities
cgroup selftests/cgroup: fix cpu.max tests 2025-07-17 08:12:19 -10:00
clone3 selftests/pidfd: fixes syscall number defines 2025-03-25 14:59:05 +01:00
connector
core
coredump selftests/coredump: Remove the read() that fails the test 2025-08-11 15:43:31 +02:00
cpu-hotplug selftests/cpu-hotplug: fix typo in hotplaggable_offline_cpus function name 2025-06-17 14:12:16 -06:00
cpufreq kselftest: cpufreq: Get rid of double suspend in rtcwake case 2025-05-09 12:43:39 -06:00
damon selftests/damon: fix selftests by installing drgn related script 2025-08-19 16:35:55 -07:00
devices
dma
dmabuf-heaps
drivers selftests: bonding: add vlan over bond testing 2025-09-17 15:13:51 -07:00
dt
efivarfs
exec
fchmodat2
filelock
filesystems vfs-6.18-rc1.mount 2025-09-29 09:32:34 -07:00
firmware
fpu
ftrace Probes updates for v6.17: 2025-07-30 15:38:01 -07:00
futex Update for the futex subsystem: 2025-07-29 14:39:42 -07:00
gpio selftests: gpio: gpio-aggregator: add a test case for _sysfs prefix reservation 2025-04-14 22:30:01 +02:00
hid hid-for-linus-2025073101 2025-07-31 21:26:05 -07:00
ia64
intel_pstate
iommu iommufd/selftest: Update the fail_nth limit 2025-09-19 10:34:49 -03:00
ipc selftests: ipc: Replace fail print statements with ksft_test_result_fail 2025-06-17 14:45:05 -06:00
ir
kcmp
kexec selftests/kexec: fix test_kexec_jump build 2025-07-22 15:10:52 -06:00
kho kho: add test for kexec handover 2025-08-02 12:01:41 -07:00
kmod lib/test_kmod: do not hardcode/depend on any filesystem 2025-05-11 17:54:09 -07:00
kselftest
kselftest_harness selftests: harness: Add kselftest harness selftest 2025-05-21 15:32:27 +02:00
kvm KVM/arm64 changes for 6.17, take #2 2025-08-29 12:57:31 -04:00
landlock selftests/landlock: Add test to check rule tied to covered mount point 2025-06-19 13:55:41 +02:00
lib lib/prime_numbers: KUnit test should not select PRIME_NUMBERS 2025-04-15 13:50:43 -07:00
livepatch Livepatching changes for 6.15 2025-03-27 19:26:10 -07:00
lkdtm stackleak: Rename STACKLEAK to KSTACK_ERASE 2025-07-21 21:35:01 -07:00
locking
lsm
media_tests
membarrier
memfd
memory-hotplug
mincore 31 hotfixes. 9 are cc:stable and the remainder address post-6.15 issues 2025-04-16 20:07:32 -07:00
mm selftests/mm: fix FORCE_READ to read input value correctly 2025-08-27 22:45:42 -07:00
module
mount
mount_setattr selftests/mount_setattr: add smoke tests for open_tree_attr(2) bug 2025-08-11 14:51:49 +02:00
move_mount_set_group
mqueue
mseal_system_mappings selftest: test system mappings are sealed 2025-04-01 15:17:16 -07:00
namespaces selftests/namespaces: verify initial namespace inode numbers 2025-09-19 16:22:38 +02:00
nci selftests: nci: Fix "Electrnoics" to "Electronics" 2025-05-20 18:13:43 -07:00
net selftests: fib_nexthops: Add test cases for FDB status change 2025-09-23 17:01:05 -07:00
nolibc selftests/nolibc: add x32 test configuration 2025-07-13 16:58:41 +02:00
ntb
openat2
pci_endpoint selftests: pci_endpoint: Add doorbell test case 2025-07-24 16:51:47 -05:00
pcie_bwctrl selftests/pcie_bwctrl: Fix test progs list 2025-04-18 08:23:22 -05:00
perf_events selftests/perf_events: Add a mmap() correctness test 2025-08-05 21:55:29 +02:00
pid_namespace selftests: pid_namespace: add missing sys/mount.h include in pid_max.c 2025-05-09 13:12:33 -06:00
pidfd linux_kselftest-next-6.17-rc1 2025-07-29 12:48:53 -07:00
power_supply
powerpc powerpc updates for 6.15 2025-03-27 19:39:08 -07:00
prctl
proc vfs-6.18-rc1.misc 2025-09-29 09:03:07 -07:00
pstore
ptp testptp: add option to enable external timestamping edges 2025-06-23 13:32:14 +01:00
ptrace Significant patch series in this pull request: 2025-08-03 16:23:09 -07:00
rcutorture Merge branches 'rcu-exp.23.07.2025', 'rcu.22.07.2025', 'torture-scripts.16.07.2025', 'srcu.19.07.2025', 'rcu.nocb.18.07.2025' and 'refscale.07.07.2025' into rcu.merge.23.07.2025 2025-07-23 21:42:20 +05:30
resctrl
ring-buffer
riscv selftests: riscv: fix v_exec_initval_nolibc.c 2025-04-01 07:03:04 +00:00
rlimits
rseq
rtc rtc: remove 'setdate' test program 2025-04-01 15:25:15 +02:00
rust
safesetid
sched
sched_ext selftests/sched_ext: Remove duplicate sched.h header 2025-08-11 08:24:08 -10:00
seccomp selftests: seccomp: Fix "performace" to "performance" 2025-05-20 13:16:39 -07:00
sgx
signal
size
sparc64
splice
static_keys
sync
syscall_user_dispatch selftests: Add tests for PR_SYS_DISPATCH_INCLUSIVE_ON 2025-06-13 18:36:39 +02:00
sysctl sysctl: Nixify sysctl.sh 2025-07-23 11:56:02 +02:00
tc-testing selftests/tc-testing: Check backlog stats in gso_skb case 2025-08-14 17:52:29 -07:00
tdx
thermal/intel selftests/thermal: remove duplicate newlines in perror calls 2025-07-19 19:08:28 -07:00
timens selftests/timens: timerfd: Use correct clockid type in tclock_gettime() 2025-05-09 13:12:57 -06:00
timers
tmpfs
tpm2 selftests: tpm2: test_smoke: use POSIX-conformant expression operator 2025-04-08 14:56:13 -06:00
tty
turbostat
ublk ublk selftests: add --no_ublk_fixed_fd for not using registered ublk char device 2025-08-28 07:56:57 -06:00
uevent
user_events
vDSO selftests: vDSO: vdso_standalone_test_x86: Replace source file with symlink 2025-07-01 15:50:43 +02:00
vsock selftests/vsock: add initial vmtest.sh for vsock 2025-06-11 13:17:59 -07:00
watchdog
wireguard selftests: net: Enable legacy netfilter legacy options. 2025-07-25 18:38:55 +02:00
x86 selftests/x86: Add a test to detect infinite SIGTRAP handler loop 2025-06-09 08:52:06 -07:00
zram
.gitignore selftests: tpm2: create a dedicated .gitignore 2025-04-08 14:56:13 -06:00
Makefile nolibc changes for v6.17 2025-07-29 15:32:02 -07:00
gen_kselftest_tar.sh
kselftest.h
kselftest_deps.sh
kselftest_harness.h selftests: harness: Rename is_signed_type() to avoid collision with overflow.h 2025-08-20 08:04:09 -07:00
kselftest_install.sh
kselftest_module.h
lib.mk
run_kselftest.sh selftests/run_kselftest.sh: Use readlink if realpath is not available 2025-05-15 16:52:47 -06:00