The Linux Kernel Mailing List
 help / color / mirror / Atom feed
From: Askar Safin <safinaskar@gmail.com>
To: brauner@kernel.org
Cc: jack@suse.cz, jannh@google.com, linux-fsdevel@vger.kernel.org,
	linux-kernel@vger.kernel.org, torvalds@linux-foundation.org,
	viro@zeniv.linux.org.uk
Subject: Re: [PATCH RFC v4 00/25] fs,kthread: start all kthreads in nullfs
Date: Sun,  5 Jul 2026 15:34:47 +0300	[thread overview]
Message-ID: <20260705123447.742980-1-safinaskar@gmail.com> (raw)
In-Reply-To: <20260601-work-kthread-nullfs-v4-0-77ee053060e0@kernel.org>

Christian Brauner <brauner@kernel.org>:
> We now also warn and notice when pid 1 simply stops sharing filesystem
> state with us, i.e., abandons it's userspace_init_fs.
> 
> On older kernels if PID 1 unshared its filesystem state with us the
> kernel simply used the stale fs_struct state implicitly pinning
> anything that PID 1 had last used. Even if PID 1 might've moved on to
> some completely different fs_struct state and might've even unmounted
> the old root.
> 
> This has hilarious consequences: Think continuing to dump coredump
> state into an implicitly pinned directory somewhere. Calling random
> binaries in the old rootfs via usermodehelpers.
> 
> Be aggressive about this: We simply reject operating on stale
> fs_struct state by reverting userspace_init_fs to nullfs. Every kworker
> that does lookups after this point will fail. Every usermodehelper call
> will fail. This is a lot stronger but I wouldn't know what it means for
> pid 1 to simply stop sharing its fs state with the kernel. Clearly it
> wanted to separate so cut all ties.

Your approach means that you introduced new degraded system state:
"PID 1 unshared its fs_struct, so we switched all kernel threads to nullfs".

I don't like this. If PID 1 tries to unshare its fs_struct, then, please,
just do nothing and return error to userspace.

(I already said this in one of previous threads about this. It seems
you missed this, so I'm saying this again.)

-- 
Askar Safin

  parent reply	other threads:[~2026-07-05 12:35 UTC|newest]

Thread overview: 28+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-06-01 13:56 [PATCH RFC v4 00/25] fs,kthread: start all kthreads in nullfs Christian Brauner
2026-06-01 13:56 ` [PATCH RFC v4 01/25] fs: add switch_fs_struct() Christian Brauner
2026-06-01 13:56 ` [PATCH RFC v4 02/25] fs: notice when init abandons fs sharing Christian Brauner
2026-06-01 13:56 ` [PATCH RFC v4 03/25] fs: add scoped_with_init_fs() Christian Brauner
2026-06-01 13:56 ` [PATCH RFC v4 04/25] fs: add real_fs to track task's actual fs_struct Christian Brauner
2026-06-01 13:56 ` [PATCH RFC v4 05/25] fs: make userspace_init_fs a dynamically-initialized pointer Christian Brauner
2026-06-01 13:56 ` [PATCH RFC v4 06/25] rnbd: use scoped_with_init_fs() for block device open Christian Brauner
2026-06-01 13:56 ` [PATCH RFC v4 07/25] crypto: ccp: use scoped_with_init_fs() for SEV file access Christian Brauner
2026-06-01 13:56 ` [PATCH RFC v4 08/25] scsi: target: use scoped_with_init_fs() for ALUA metadata Christian Brauner
2026-06-01 13:56 ` [PATCH RFC v4 09/25] scsi: target: use scoped_with_init_fs() for APTPL metadata Christian Brauner
2026-06-01 13:56 ` [PATCH RFC v4 10/25] btrfs: use scoped_with_init_fs() for update_dev_time() Christian Brauner
2026-06-01 13:56 ` [PATCH RFC v4 11/25] coredump: use scoped_with_init_fs() for coredump path resolution Christian Brauner
2026-06-01 13:56 ` [PATCH RFC v4 12/25] fs: use scoped_with_init_fs() for kernel_read_file_from_path_initns() Christian Brauner
2026-06-01 13:56 ` [PATCH RFC v4 13/25] ksmbd: use scoped_with_init_fs() for share path resolution Christian Brauner
2026-06-01 13:56 ` [PATCH RFC v4 14/25] ksmbd: use scoped_with_init_fs() for filesystem info path lookup Christian Brauner
2026-06-01 13:56 ` [PATCH RFC v4 15/25] ksmbd: use scoped_with_init_fs() for VFS path operations Christian Brauner
2026-06-01 13:56 ` [PATCH RFC v4 16/25] pnfs/blocklayout: use scoped_with_init_fs() for SCSI device lookup Christian Brauner
2026-06-01 13:56 ` [PATCH RFC v4 17/25] initramfs: use scoped_with_init_fs() for rootfs unpacking Christian Brauner
2026-06-01 13:56 ` [PATCH RFC v4 18/25] af_unix: use scoped_with_init_fs() for coredump socket lookup Christian Brauner
2026-06-01 13:56 ` [PATCH RFC v4 19/25] fs: stop sharing fs_struct between init_task and pid 1 Christian Brauner
2026-06-01 13:56 ` [PATCH RFC v4 20/25] fs: add umh argument to struct kernel_clone_args Christian Brauner
2026-06-01 13:56 ` [PATCH RFC v4 21/25] devtmpfs: create private mount namespace Christian Brauner
2026-06-01 13:56 ` [PATCH RFC v4 22/25] nullfs: make nullfs multi-instance Christian Brauner
2026-06-01 13:56 ` [PATCH RFC v4 23/25] fs: start all kthreads in nullfs Christian Brauner
2026-06-01 13:56 ` [PATCH RFC v4 24/25] fs: stop rewriting kthread fs structs Christian Brauner
2026-06-01 13:56 ` [PATCH RFC v4 25/25] fs: stop rewriting paths for PF_EXITING | PF_DUMPCORE Christian Brauner
2026-07-05 12:34 ` Askar Safin [this message]
2026-07-05 12:57 ` [PATCH RFC v4 00/25] fs,kthread: start all kthreads in nullfs Askar Safin

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=20260705123447.742980-1-safinaskar@gmail.com \
    --to=safinaskar@gmail.com \
    --cc=brauner@kernel.org \
    --cc=jack@suse.cz \
    --cc=jannh@google.com \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=torvalds@linux-foundation.org \
    --cc=viro@zeniv.linux.org.uk \
    /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