exit: Making task exiting a first class concept
Get series with b4
b4 am [email protected]Versions newest first
- v1 Latest17 patches 16 repliesIn review
Patches in v1 No applies recorded yet
| # | Subject and files | Size | Replies | Applied |
|---|---|---|---|---|
| 1/17 | exit: Remove profile_task_exit & profile_munmapinclude/ kernel/ kernel/ +1 more | +0 | 3 replies | |
| 2/17 | exit: Coredumps reach do_group_exitkernel/ | +0 | 0 replies | |
| 3/17 | exit: Fix the exit_code for wait_task_zombiekernel/ | +2 | 0 replies | |
| 4/17 | exit: Use the correct exit_code in /proc/<pid>/statfs/ | +5 | 0 replies | |
| 5/17 | taskstats: Cleanup the use of task->exit_codekernel/ | +3 | 0 replies | |
| 6/17 | ptrace: Remove second setting of PT_SEIZED in ptrace_attachkernel/ | +0 | 0 replies | |
| 7/17 | ptrace: Remove unused regs argument from ptrace_report_syscallinclude/ | +3 | 0 replies | |
| 8/17 | ptrace/m68k: Stop open coding ptrace_report_syscallarch/ | +1 | 13 replies | |
| 9/17 | ptrace: Move setting/clearing ptrace_message into ptrace_stopinclude/ include/ kernel/ | +15 | 0 replies | |
| 10/17 | ptrace: Return the signal to continue with from ptrace_stopinclude/ include/ kernel/ | +24 | 0 replies | |
| 11/17 | ptrace: Separate task->ptrace_code out from task->exit_codefs/ include/ kernel/ +2 more | +20 | 0 replies | |
| 12/17 | signal: Compute the process exit_code in get_signalkernel/ | +12 | 0 replies | |
| 13/17 | signal: Make individual tasks exiting a first class conceptfs/ include/ kernel/ | +25 | 0 replies | |
| 14/17 | signal: Remove zap_other_threadsfs/ include/ kernel/ +1 more | +17 | 0 replies | |
| 15/17 | signal: Add JOBCTL_WILL_EXIT to mark exiting tasksfs/ include/ include/ +2 more | +18 | 0 replies | |
| 16/17 | signal: Record the exit_code when an exit is scheduledfs/ fs/ include/ +2 more | +15 | 0 replies | |
| 17/17 | signal: Always set SIGNAL_GROUP_EXIT on process exitfs/ include/ kernel/ +2 more | +11 | 0 replies |
Reviews trailers per patch
2 of 17 patches have a Reviewed-by or Acked-by of their own; the series has one for all of them.
| Patch | Christoph Hellwig | Geert Uytterhoeven | Kees Cook | Oleg Nesterov |
|---|---|---|---|---|
| Series | R-b R-b R-b R-b R-b R-b R-b R-b R-b R-b R-b R-b R-b R-b R-b | A-b A-b | ||
| 1/17 | R-b | |||
| 2/17 | ||||
| 3/17 | ||||
| 4/17 | ||||
| 5/17 | ||||
| 6/17 | ||||
| 7/17 | ||||
| 8/17 | A-b | |||
| 9/17 | ||||
| 10/17 | ||||
| 11/17 | ||||
| 12/17 | ||||
| 13/17 | ||||
| 14/17 | ||||
| 15/17 | ||||
| 16/17 | ||||
| 17/17 |
Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes. Scroll the table sideways for all 4 reviewers.
Cover letter [PATCH 00/17] exit: Making task exiting a first class concept
The changes below contain some cleanups and the work to make implement first class asynchronous task exit. Most of the cleanups are necessary for this work but a couple of them (removing profile_task_exit and the extra setting of PT_SEIZED in ptrace_attach) are included because I stumbled over them and they are worth applying but they aren't interesting enough to me to make be in their own patchset.
The core of this set of changes is the addition of schedule_task_exit_locked. Ptrace is cleaned up to avoid a conflict in task->exit_code. Then the existing task exit code is gradually moved into the final shape of schedule_task_exit_locked.
This is the fundamental building block I need to fix alpha, m68k, nios2 and any other architecture that does not always save all of their registers except when entering into a ptrace context.
This is about half the work to allow coredump signals to use short-circuit delivery.
With coredumps signals available for short-circuit delivery the SA_IMMUTABLE hack can be replace by something clean.
The counting of the number of threads that have not been killed to always set SIGNAL_GROUP_EXIT when a process exits and the coredump signal short-circuit delivery is a foundation for updating the SECCOMP_RET_KILL_THREAD implementation such that it can decide if it should coredump without races.
I have most of those changes pretty much ready I just need to get these changes finalized reviewed first. At this point they are looking at v5.18 material.
These patches are on top of:
https://git.kernel.org/pub/scm/linux/kernel/git/ebiederm/user-namespace.git/ signal-for-v5.17
After these patches have been reviewed it is my plan to apply them to my signal-for-v5.17 branch. Any and all feedback is welcome.
Eric W. Biederman (17):
exit: Remove profile_task_exit & profile_munmap
exit: Coredumps reach do_group_exit
exit: Fix the exit_code for wait_task_zombie
exit: Use the correct exit_code in /proc/<pid>/stat
taskstats: Cleanup the use of task->exit_code
ptrace: Remove second setting of PT_SEIZED in ptrace_attach
ptrace: Remove unused regs argument from ptrace_report_syscall ptrace/m68k: Stop open coding ptrace_report_syscall
ptrace: Move setting/clearing ptrace_message into prace_stop
ptrace: Return the signal to continue with from ptrace_stop
ptrace: Separate task->ptrace_code out from task->exit_code
signal: Compute the process exit_code in get_signal
signal: Make individual tasks exiting a first class concept
signal: Remove zap_other_threads
signal: Add JOBCTL_WILL_EXIT to mark exiting tasks
signal: Record the exit_code when an exit is scheduled
signal: Always set SIGNAL_GROUP_EXIT on process exit
arch/m68k/kernel/ptrace.c | 12 +---- fs/coredump.c | 17 +++--- fs/exec.c | 12 +++-- fs/proc/array.c | 9 +++- include/linux/profile.h | 26 --------- include/linux/ptrace.h | 5 +- include/linux/sched.h | 1 + include/linux/sched/jobctl.h | 2 + include/linux/sched/signal.h | 6 ++- include/linux/tracehook.h | 21 ++++---- kernel/exit.c | 29 +++++----- kernel/fork.c | 2 + kernel/profile.c | 50 ------------------ kernel/ptrace.c | 14 +++-- kernel/signal.c | 122 +++++++++++++++++++++++-------------------- kernel/tsacct.c | 7 ++- mm/mmap.c | 1 - 17 files changed, 134 insertions(+), 202 deletions(-)