Files
ack-tegra/include/linux
Christian Brauner (Amutable) 6b1c66c9cc exec_state: relocate dumpable information
The dumpable flag captured at execve() is consulted by
__ptrace_may_access() and several /proc owner / visibility checks.
It lives on mm_struct today, which exit_mm() clears from the task
long before the task itself is reaped.

exec_state is anchored to the execve() that established the current
privilege domain.  CLONE_VM siblings refcount-share the parent's
exec_state via copy_exec_state(); non-CLONE_VM clones allocate a
fresh exec_state inheriting the parent's dumpable mode and user_ns
reference via task_exec_state_copy().  execve() allocates a fresh
instance (via alloc_task_exec_state() in begin_new_exec()) and
installs it under task_lock + exec_update_lock with
task_exec_state_replace().  init_task uses a static instance.

The dumpable mode now lives on task->exec_state->dumpable.
task->mm->flags no longer carries dumpability; MMF_DUMPABLE_MASK is
removed, but MMF_DUMPABLE_BITS is reserved so MMF_DUMP_FILTER_* bit
positions remain stable for the /proc/<pid>/coredump_filter ABI. The
task->user_dumpable cache bit and its assignment in exit_mm() are
removed; readers go through get_dumpable(task) directly.

coredump_params gains a snapshot field cprm.dumpable, populated from
get_dumpable(current) at vfs_coredump() entry, replacing the previous
__get_dumpable(cprm->mm_flags) consumers in fs/coredump.c and
fs/pidfs.c.

The user namespace recorded at execve() is consulted by
__ptrace_may_access() and by /proc/PID/* owner derivation. Move the
captured user_ns onto task_exec_state, which stays attached to the task
past exit_mm() and across exit_files().

bprm grows a user_ns field staged in bprm_mm_init() with the caller's
user_ns, narrowed by would_dump() to the closest privileged ancestor,
and consumed by exec_mmap() via alloc_task_exec_state(bprm->user_ns).
free_bprm() releases the staging reference.

mm_struct loses ->user_ns entirely.  Initializers in init-mm, efi_mm,
and the implicit one in mm_init()/dup_mm()/mm_alloc() are removed;
__mmdrop() drops the matching put_user_ns(). The kthread_use_mm()
WARN_ON_ONCE(!mm->user_ns) is no longer meaningful and goes too.

Reviewed-by: Jann Horn <jannh@google.com>
Link: https://patch.msgid.link/20260520-work-task_exec_state-v3-4-69f895bc1385@kernel.org
Signed-off-by: Christian Brauner (Amutable) <brauner@kernel.org>
2026-05-26 11:02:01 +02:00
..
…
…
…
…
…
…
…
…
2026-04-02 15:52:49 +02:00
2026-03-18 15:11:40 +05:30
…
2026-03-19 23:55:27 +01:00
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
2026-04-03 16:53:50 -04:00
…
…
…
…
…
…
…
…
…
…
…
2026-04-22 12:58:57 -07:00
…
…
…
…
…
…
…
…
2026-04-04 08:10:37 -06:00
…
…
…
…
…
…
2026-03-16 13:16:49 +01:00
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
2026-03-31 19:15:21 +02:00
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
2026-04-16 07:03:40 -07:00
2026-03-23 13:33:51 -04:00
…
…
2026-04-07 17:38:07 +02:00
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
2026-04-05 13:53:28 -07:00
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
2026-04-01 10:19:41 +02:00
…
…
…
…
…
…
…
…
…
2026-04-03 16:53:50 -04:00
2026-04-03 16:53:50 -04:00
…
…
…
…
…
2026-03-18 09:59:57 +00:00
…
…
…
…
…
…
2026-04-06 11:39:54 +02:00
2026-04-05 13:53:00 -07:00
…
…
2026-03-17 15:34:47 +05:30
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
2026-03-08 11:06:53 +01:00
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
2026-03-27 07:35:05 -07:00
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
2026-04-05 13:53:10 -07:00
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
2026-04-20 11:35:17 -07:00
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
2026-03-27 17:14:31 -07:00
2026-05-26 11:02:01 +02:00
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
2026-03-08 11:06:53 +01:00
…
…
…
…
…
2026-03-31 07:04:00 -06:00
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
2026-05-05 16:12:07 +08:00
…
…
…
2026-03-25 20:11:29 +01:00
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
2026-03-23 12:41:58 +01:00
…
…
…
…
…
…
2026-03-13 08:22:54 +01:00
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
2026-03-12 15:05:34 +01:00
…
…
2026-04-13 08:39:51 -07:00
…
…
…
…
…
…
…
…
2026-04-06 09:06:39 +02:00
…
…
…
…
2026-03-30 16:43:24 -06:00
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…