[PATCH 65] don't clear context->ev_code for debugging

Oleg Nesterov oleg at redhat.com
Tue Oct 6 00:11:37 UTC 2009


do_ptrace_notify_stop() clears ->ev_code for debugging purposes,
remove this. We need the valid ->ev_code in ptrace_getsiginfo().

---

 kernel/ptrace.c |   11 ++---------
 1 file changed, 2 insertions(+), 9 deletions(-)

--- PU/kernel/ptrace.c~65_DONT_CLEAR_EV_CODE	2009-10-06 00:47:13.000000000 +0200
+++ PU/kernel/ptrace.c	2009-10-06 00:50:01.000000000 +0200
@@ -308,7 +308,6 @@ static u32 ptrace_report_signal(u32 acti
 	enum utrace_resume_action resume = context->resume;
 
 	if (ev_pending(context)) {
-		WARN_ON(!context->ev_code && !fatal_signal_pending(task));
 		action = utrace_signal_action(action);
 		WARN_ON(action != UTRACE_SIGNAL_REPORT);
 		return action | UTRACE_STOP;
@@ -361,10 +360,8 @@ static u32 ptrace_report_quiesce(u32 act
 {
 	struct ptrace_context *context = ptrace_context(engine);
 
-	if (ev_pending(context)) {
-		WARN_ON(!context->ev_code && !fatal_signal_pending(task) && !(task->flags & PF_EXITING));
+	if (ev_pending(context))
 		return UTRACE_STOP;
-	}
 
 	return event ? UTRACE_RESUME : context->resume;
 }
@@ -813,7 +810,7 @@ static int ptrace_getsiginfo(struct ptra
 
 	memset(info, 0, sizeof(*info));
 	info->si_signo = SIGTRAP;
-	info->si_code = context->ev_code; // XXX: ev_code was already cleared!!!
+	info->si_code = context->ev_code;
 	info->si_pid = task_pid_vnr(tracee);
 	info->si_uid = task_uid(tracee);
 
@@ -858,10 +855,6 @@ static void do_ptrace_notify_stop(struct
 {
 	tracee->exit_code = context->ev_code;
 
-	// XXX: for debug only
-	WARN_ON(!context->ev_code);
-	context->ev_code = 0;
-
 	read_lock(&tasklist_lock);
 	/*
 	 * Don't want to allow preemption here, because




More information about the utrace-devel mailing list