diff options
| author | Christian Brauner <brauner@kernel.org> | 2026-05-21 15:34:13 +0200 |
|---|---|---|
| committer | Christian Brauner <brauner@kernel.org> | 2026-05-21 15:34:13 +0200 |
| commit | 7a2297f2a9b07a737a59592be8cdcb6843025b8c (patch) | |
| tree | 1402256243b50de2f9c25e440fcadfaff5c94405 /init | |
| parent | d687e16b5295b5fd9599b54a4943033bceb9c078 (diff) | |
| parent | 2a30fad67ac4748784f417aee3d003c24bbf3293 (diff) | |
| download | linux-next-history-7a2297f2a9b07a737a59592be8cdcb6843025b8c.tar.gz | |
Merge branch 'kernel-7.2.task_exec_state' into vfs.all
Signed-off-by: Christian Brauner <brauner@kernel.org>
Diffstat (limited to 'init')
| -rw-r--r-- | init/init_task.c | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/init/init_task.c b/init/init_task.c index b5f48ebdc2b6e..8cad78da469c9 100644 --- a/init/init_task.c +++ b/init/init_task.c @@ -7,6 +7,8 @@ #include <linux/sched/rt.h> #include <linux/sched/task.h> #include <linux/sched/ext.h> +#include <linux/sched/exec_state.h> +#include <linux/user_namespace.h> #include <linux/init.h> #include <linux/fs.h> #include <linux/mm.h> @@ -56,6 +58,13 @@ static struct sighand_struct init_sighand = { .signalfd_wqh = __WAIT_QUEUE_HEAD_INITIALIZER(init_sighand.signalfd_wqh), }; +/* init to 2 - one for init_task, one to ensure it is never freed */ +struct task_exec_state init_task_exec_state = { + .count = REFCOUNT_INIT(2), + .dumpable = TASK_DUMPABLE_OWNER, + .user_ns = &init_user_ns, +}; + #ifdef CONFIG_SHADOW_CALL_STACK unsigned long init_shadow_call_stack[SCS_SIZE / sizeof(long)] = { [(SCS_SIZE / sizeof(long)) - 1] = SCS_END_MAGIC @@ -113,6 +122,7 @@ struct task_struct init_task __aligned(L1_CACHE_BYTES) = { .nr_cpus_allowed= NR_CPUS, .mm = NULL, .active_mm = &init_mm, + .exec_state = &init_task_exec_state, .restart_block = { .fn = do_no_restart_syscall, }, |
