linux/init
Christian Brauner 14adbd5341
fs: stop sharing fs_struct between init_task and pid 1
Spawn kernel_init (PID 1) via kernel_clone() directly instead of
user_mode_thread(), without CLONE_FS. This gives PID 1 its own private
copy of init_task's fs_struct rather than sharing it.

This is a prerequisite for isolating kthreads in nullfs: when
init_task's fs is later pointed at nullfs, PID 1 must not share it
or init_userspace_fs() would modify init_task's fs as well, defeating
the isolation.

At this stage PID 1 still gets rootfs (a private copy rather than a
shared reference), so there is no functional change.

Link: https://patch.msgid.link/20260601-work-kthread-nullfs-v4-19-77ee053060e0@kernel.org
Signed-off-by: Christian Brauner (Amutable) <brauner@kernel.org>
2026-06-29 10:53:32 +02:00
..
.gitignore
.kunitconfig initramfs_test: kunit tests for initramfs unpacking 2025-03-08 12:13:04 +01:00
calibrate.c calibrate: update header inclusion 2025-11-27 14:24:45 -08:00
do_mounts_initrd.c init: remove /proc/sys/kernel/real-root-dev 2026-01-12 17:22:27 +01:00
do_mounts_rd.c initrd: remove deprecated code path (linuxrc) 2026-01-12 17:22:22 +01:00
do_mounts.c init: do_mounts: use kmalloc() for allocations of temporary buffers 2026-05-22 12:12:20 +02:00
do_mounts.h fs: use nullfs unconditionally as the real rootfs 2026-01-14 11:23:39 +01:00
init_task.c fs: add real_fs to track task's actual fs_struct 2026-06-29 10:43:45 +02:00
initramfs_internal.h init: add initramfs_internal.h 2025-03-04 09:52:36 +01:00
initramfs_test.c init/initramfs_test: wait_for_initramfs() before running 2026-05-27 15:11:02 +02:00
initramfs.c initramfs: use scoped_with_init_fs() for rootfs unpacking 2026-06-29 10:53:31 +02:00
Kconfig mm.git review status for mm-hotfixes-stable..mm-nonmm-stable 2026-06-21 13:20:19 -07:00
main.c fs: stop sharing fs_struct between init_task and pid 1 2026-06-29 10:53:32 +02:00
Makefile initramfs_test: kunit tests for initramfs unpacking 2025-03-08 12:13:04 +01:00
noinitramfs.c
version-timestamp.c ns: drop custom reference count initialization for initial namespaces 2025-11-11 10:01:32 +01:00
version.c init/version.c: Replace strlcpy with strscpy 2023-09-22 09:50:56 -07:00