diff options
| author | Christian Brauner <brauner@kernel.org> | 2026-06-01 15:56:53 +0200 |
|---|---|---|
| committer | Christian Brauner <brauner@kernel.org> | 2026-06-29 10:54:41 +0200 |
| commit | ed4b1672529018b2013c62235c4bf1ab0ae0e3d4 (patch) | |
| tree | 69ad565641c1ef8f6c127ecbb082be290e1c4ef3 /include/linux/sched/task.h | |
| parent | 14adbd5341aae18e7e14bc3786b49007c26b2503 (diff) | |
| download | linux-next-ed4b1672529018b2013c62235c4bf1ab0ae0e3d4.tar.gz linux-next-ed4b1672529018b2013c62235c4bf1ab0ae0e3d4.zip | |
fs: add umh argument to struct kernel_clone_args
Add a umh field to struct kernel_clone_args. When set, copy_fs() copies
from pid 1's fs_struct instead of the kthread's fs_struct. This ensures
usermodehelper threads always get init's filesystem state regardless of
their parent's (kthreadd's) fs.
Usermodehelper threads are not allowed to create mount namespaces
(CLONE_NEWNS), share filesystem state (CLONE_FS), or be started from
a non-initial mount namespace. No usermodehelper currently does this so
we don't need to worry about this restriction.
Set .umh = 1 in user_mode_thread(). At this stage pid 1's fs points to
rootfs which is the same as kthreadd's fs, so this is functionally
equivalent.
Link: https://patch.msgid.link/20260601-work-kthread-nullfs-v4-20-77ee053060e0@kernel.org
Signed-off-by: Christian Brauner (Amutable) <brauner@kernel.org>
Diffstat (limited to 'include/linux/sched/task.h')
| -rw-r--r-- | include/linux/sched/task.h | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/include/linux/sched/task.h b/include/linux/sched/task.h index 41ed884cffc9..e0c1ca8c6a18 100644 --- a/include/linux/sched/task.h +++ b/include/linux/sched/task.h @@ -31,6 +31,7 @@ struct kernel_clone_args { u32 io_thread:1; u32 user_worker:1; u32 no_files:1; + u32 umh:1; unsigned long stack; unsigned long stack_size; unsigned long tls; |
