On 07/01, Oleg Nesterov wrote: > > Another attempt. This version tries to decouple utrace and ptrace. > This way it is much simpler to follow the upstream changes, afaics. > > TODO: > > - The single-stepping updates in ptrace_resume() can race > with utrace_reset()->user_disable_single_step(). > > This was fixed by 20/20, but I noticed that this patch > is buggy right before sending.
1/2 replaces 19/19 I sent yesterday, 2/2 fixes the race above. The whole series is available in the following git branch git://git.kernel.org/pub/scm/linux/kernel/git/oleg/misc.git utrace Oleg Nesterov (19): utrace: remove jobctl bits ptrace: take ->siglock around s/TRACED/RUNNING/ introduce wake_up_quiescent() introduce ptrace_signal_wake_up() wait_task_inactive: treat task->state and match_state as bitmasks introduce TASK_UTRACED state utrace: use TASK_UTRACED instead of TASK_TRACED tracehooks: kill tracehook_finish_jctl(), add tracehook_finish_stop() teach wake_up_quiescent() to do "selective" wake_up ptrace_stop: do not assume the task is running after wake_up_quiescent() get_signal_to_deliver: restructure utrace/ptrace signal reporting introduce ptrace_set_syscall_trace() introduce PT_SYSCALL_TRACE flag utrace: don't clear TIF_SYSCALL_TRACE if it is needed by ptrace introduce task_utrace_lock/task_utrace_unlock teach ptrace_set_syscall_trace() to play well with utrace introduce PT_SINGLE_STEP and PT_SINGLE_BLOCK utrace: finish_resume_report: don't do user_xxx_step() if ptrace_wants_step() ptrace: shift user_*_step() from ptrace_resume() to ptrace_stop() Roland McGrath (1): utrace core Documentation/DocBook/Makefile | 2 +- Documentation/DocBook/utrace.tmpl | 589 +++++++++ arch/x86/kernel/ptrace.c | 1 + fs/proc/array.c | 14 +- include/linux/ptrace.h | 6 + include/linux/sched.h | 25 +- include/linux/signal.h | 2 + include/linux/tracehook.h | 100 ++- include/linux/utrace.h | 701 +++++++++++ init/Kconfig | 9 + kernel/Makefile | 1 + kernel/fork.c | 3 + kernel/ptrace.c | 53 +- kernel/sched.c | 2 +- kernel/signal.c | 79 +- kernel/utrace.c | 2460 +++++++++++++++++++++++++++++++++++++ 16 files changed, 3995 insertions(+), 52 deletions(-) create mode 100644 Documentation/DocBook/utrace.tmpl create mode 100644 include/linux/utrace.h create mode 100644 kernel/utrace.c