[PATCH 71-72] renames, -siginfo tweaks

2009-10-09 Thread Oleg Nesterov
Rework get/set siginfo logic. We should never rely on -siginfo != NULL checks. This is subtle, and if we implement the re-using of engine/context, this just can't work. Oleg.

[PATCH 72] introduce set_stop_code() helper

2009-10-09 Thread Oleg Nesterov
Trivial, add set_stop_code() and turn syscall_code() into set_syscall_code(). --- kernel/ptrace.c | 28 1 file changed, 16 insertions(+), 12 deletions(-) --- PU/kernel/ptrace.c~72_SET_CODE_HELPER 2009-10-09 14:18:55.0 +0200 +++ PU/kernel/ptrace.c

[PATCH 73] rework access to context-siginfo

2009-10-09 Thread Oleg Nesterov
To simplify the review: static int ptrace_rw_siginfo(struct task_struct *tracee, struct ptrace_context *context, siginfo_t *info, bool write) { unsigned long flags; int

[PATCH 74] implement the basic detach-with-signal logic

2009-10-09 Thread Oleg Nesterov
Introduce detach_signal(sig) helper. It is called by ptrace_detach_task() instead of removed ptrace_do_detach()-send_sig(). !valid_signal(sig) means that the tracer exits and detaches implicitly. If sig == 0 - nothing to do, just detach and return. If the tracee reported the signal, it will be

[PATCH 77] implement UTRACE_ATTACH_MATCH_CHECK

2009-10-09 Thread Oleg Nesterov
Implement UTRACE_ATTACH_MATCH_CHECK. With this flag utrace_attach_task(data) data is the function pointer which checks engine-data instead of simple comparison. Todo: comment + rename. --- include/linux/utrace.h |1 + kernel/utrace.c|5 + 2 files changed, 6 insertions(+)

[PATCH 78] attach: try to re-use the self-detaching engine

2009-10-09 Thread Oleg Nesterov
Change ptrace_attach_task() to re-use the self-detaching engine first, then do utrace_attach_task(UTRACE_ATTACH_CREATE). Todo: - re-check this all (and test) - rename check() - cleanups the mess in ptrace_attach_task() - ptrace_detach_task() should clear