diff options
author | Oleg Nesterov <oleg@redhat.com> | 2012-03-23 18:02:40 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2012-03-23 19:58:40 -0400 |
commit | b1845ff53f1a9eadba005ae53dfe60ab00dfe83b (patch) | |
tree | 1c38877029c0ffe0844cbbe7b0e022e8f79b6235 /include/linux | |
parent | 15cab952139404d0e593cb1aaab0a3547ac0f95b (diff) |
ptrace: don't send SIGTRAP on exec if SEIZED
ptrace_event(PTRACE_EVENT_EXEC) sends SIGTRAP if PT_TRACE_EXEC is not
set. This is because this SIGTRAP predates PTRACE_O_TRACEEXEC option,
we do not need/want this with PT_SEIZED which can set the options during
attach.
Suggested-by: Pedro Alves <palves@redhat.com>
Signed-off-by: Oleg Nesterov <oleg@redhat.com>
Cc: Chris Evans <scarybeasts@gmail.com>
Cc: Indan Zupancic <indan@nul.nu>
Cc: Denys Vlasenko <vda.linux@googlemail.com>
Cc: Tejun Heo <tj@kernel.org>
Cc: Pedro Alves <palves@redhat.com>
Cc: Jan Kratochvil <jan.kratochvil@redhat.com>
Cc: Steven Rostedt <rostedt@goodmis.org>
Cc: Frederic Weisbecker <fweisbec@gmail.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'include/linux')
-rw-r--r-- | include/linux/ptrace.h | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/include/linux/ptrace.h b/include/linux/ptrace.h index c2f1f6a5fcb8..6fdb196caa3e 100644 --- a/include/linux/ptrace.h +++ b/include/linux/ptrace.h | |||
@@ -199,9 +199,10 @@ static inline void ptrace_event(int event, unsigned long message) | |||
199 | if (unlikely(ptrace_event_enabled(current, event))) { | 199 | if (unlikely(ptrace_event_enabled(current, event))) { |
200 | current->ptrace_message = message; | 200 | current->ptrace_message = message; |
201 | ptrace_notify((event << 8) | SIGTRAP); | 201 | ptrace_notify((event << 8) | SIGTRAP); |
202 | } else if (event == PTRACE_EVENT_EXEC && unlikely(current->ptrace)) { | 202 | } else if (event == PTRACE_EVENT_EXEC) { |
203 | /* legacy EXEC report via SIGTRAP */ | 203 | /* legacy EXEC report via SIGTRAP */ |
204 | send_sig(SIGTRAP, current, 0); | 204 | if ((current->ptrace & (PT_PTRACED|PT_SEIZED)) == PT_PTRACED) |
205 | send_sig(SIGTRAP, current, 0); | ||
205 | } | 206 | } |
206 | } | 207 | } |
207 | 208 | ||