[PATCH 40] PTRACE_EVENT_VFORK_DONE: set ev_options = PTRACE_O_TRACEVFORKDONE

2009-09-15 Thread Oleg Nesterov
PTRACE_EVENT_VFORK_DONE should not be reported if the tracer cleared PTRACE_O_TRACEVFORKDONE after the tracee stopped in PTRACE_EVENT_VFORK report. Now that we have ptrace_event->ev_options this is trivial. ptrace_report_clone() still needs more changes. I think it is simple to fix it now, but ca

[PATCH 39] make sure PTRACE_SYSCALL reports SYSCALL_EXIT

2009-09-15 Thread Oleg Nesterov
Another test-case: #define WEVENT(s) ((s & 0xFF) >> 16) int main(void) { int pid, stat; pid = fork(); if (!pid) { assert(0 == ptrace(PTRACE_TRACEME, 0,0,0)); kill(getpid(),

[PATCH 38] make sure PTRACE_CONT "disables" SYSCALL_EXIT report

2009-09-15 Thread Oleg Nesterov
I am a bit surprised there is nothing in ptrace-tests to check CONT/SYSCALL behaviour. I had to write this one: #define WEVENT(s) ((s & 0xFF) >> 16) int main(void) { int pid, stat; pid = fork(); if (!pid) {

[PATCH 37] introduce ptrace_event->ev_options

2009-09-15 Thread Oleg Nesterov
When the tracee resumes from TASK_TRACED, context->options can be changed. Introduce ptrace_event->ev_options. If a callback sets ->ev_options != 0, do_ptrace_resume() checks that context->options matches or discards the event. This will be used to validate PTRACE_EVENT_VFORK_DONE and SYSCALL_EXI

[PATCH 36] convert ptrace_report_exec()

2009-09-15 Thread Oleg Nesterov
Change ptrace_report_exec() to use ptrace_event. Now we should fix EXEC/SYSCALL_EXIT interaction wrt PTRACE_CONT/SYSCALL. --- kernel/ptrace.c | 44 +--- 1 file changed, 25 insertions(+), 19 deletions(-) --- PU/kernel/ptrace.c~36_REPORT_EXEC 2009-09-1

[PATCH 35] convert ptrace_report_syscall_entry()

2009-09-15 Thread Oleg Nesterov
Change ptrace_report_syscall_entry() to use ptrace_event. I am worried about PTRACE_SYSEMU, I continue to ignore this magic which I don't understand yet... Hopefully I will be able to add the necessary changes later. --- kernel/ptrace.c | 57 ++-

[PATCH 34] cleanup/simplify stop/resume mess

2009-09-15 Thread Oleg Nesterov
The code still needs comments. I'll try to explain how the code should work at least here. struct ptrace_event { int ev_code; unsigned long ev_message; resume_func_t ev_resume; }; This represents the state of the trac

[PATCH 34-40] stop/resume cleanups, exec/syscall conversions

2009-09-15 Thread Oleg Nesterov
I didn't have time to finish ptrace_report_clone(), but I think this will be simple now... Oleg.