[PATCH 101] do_ptrace_resume: always use ptrace_wake_up()
Oleg Nesterov
oleg at redhat.com
Sun Oct 18 18:14:03 UTC 2009
do_ptrace_resume(PTRACE_EVENT_VFORK) can't use ptrace_wake_up()
because it clears context->stop_code.
Not good, we should follow the "force_wakeup" logic, and it is
always good to consolidate the calls to utrace layer.
Change ptrace_wake_up() to check "action != UTRACE_REPORT" and
change do_ptrace_resume() to rely on ptrace_wake_up().
---
kernel/ptrace.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
--- PU/kernel/ptrace.c~101_RESUME_ALWAYS_USE_WAKEUP 2009-10-18 16:51:38.000000000 +0200
+++ PU/kernel/ptrace.c 2009-10-18 18:34:55.000000000 +0200
@@ -960,7 +960,8 @@ static void ptrace_wake_up(struct task_s
}
}
- ptrace_context(engine)->stop_code = 0;
+ if (action != UTRACE_REPORT)
+ ptrace_context(engine)->stop_code = 0;
utrace_control(tracee, engine, action);
}
@@ -975,8 +976,7 @@ static void do_ptrace_resume(struct utra
case PTRACE_EVENT_VFORK:
if (context->options & PTRACE_O_TRACEVFORKDONE) {
set_stop_code(context, PTRACE_EVENT_VFORK_DONE);
- utrace_control(tracee, engine, UTRACE_REPORT);
- return;
+ action = UTRACE_REPORT;
}
break;
More information about the utrace-devel
mailing list