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.
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
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
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
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(+)
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