From 069d60ffb7f0fe817a0868733ebef876f00b8e7e Mon Sep 17 00:00:00 2001 From: Tejun Heo Date: Fri, 17 Jun 2011 16:50:36 +0200 Subject: [PATCH] --- yaml --- r: 256847 b: refs/heads/master c: f3c04b934d429b1ace21866f011b66de328c0dc9 h: refs/heads/master i: 256845: e76dceb6abd1dd6588692681201ccf527d73788c 256843: 0769f93ae90c2969f98fc8c2ac4dd673be8171eb 256839: f4f0f8a8c6095ca162028762d989606533984e33 256831: 7867b8ad1752077f898775441e372a2b2056e3f1 v: v3 --- [refs] | 2 +- trunk/include/linux/ptrace.h | 16 ++++++++-------- trunk/include/linux/tracehook.h | 4 +--- 3 files changed, 10 insertions(+), 12 deletions(-) diff --git a/[refs] b/[refs] index d8999ae181c2..ed55ce59f3cc 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: 643ad8388e189dfd14ef76972cf7dc394b3cbebd +refs/heads/master: f3c04b934d429b1ace21866f011b66de328c0dc9 diff --git a/trunk/include/linux/ptrace.h b/trunk/include/linux/ptrace.h index 18feac6f441e..b546fd6c3506 100644 --- a/trunk/include/linux/ptrace.h +++ b/trunk/include/linux/ptrace.h @@ -172,17 +172,17 @@ static inline bool ptrace_event_enabled(struct task_struct *task, int event) * Check whether @event is enabled and, if so, report @event and @message * to the ptrace parent. * - * Returns nonzero if we did a ptrace notification, zero if not. - * * Called without locks. */ -static inline int ptrace_event(int event, unsigned long message) +static inline void ptrace_event(int event, unsigned long message) { - if (likely(!ptrace_event_enabled(current, event))) - return false; - current->ptrace_message = message; - ptrace_notify((event << 8) | SIGTRAP); - return true; + if (unlikely(ptrace_event_enabled(current, event))) { + current->ptrace_message = message; + ptrace_notify((event << 8) | SIGTRAP); + } else if (event == PTRACE_EVENT_EXEC && unlikely(current->ptrace)) { + /* legacy EXEC report via SIGTRAP */ + send_sig(SIGTRAP, current, 0); + } } /** diff --git a/trunk/include/linux/tracehook.h b/trunk/include/linux/tracehook.h index 7d38571b0c05..3b68aa842a92 100644 --- a/trunk/include/linux/tracehook.h +++ b/trunk/include/linux/tracehook.h @@ -201,9 +201,7 @@ static inline void tracehook_report_exec(struct linux_binfmt *fmt, struct linux_binprm *bprm, struct pt_regs *regs) { - if (!ptrace_event(PTRACE_EVENT_EXEC, 0) && - unlikely(current->ptrace & PT_PTRACED)) - send_sig(SIGTRAP, current, 0); + ptrace_event(PTRACE_EVENT_EXEC, 0); } /**