tracehook: exec
This moves all the ptrace hooks related to exec into tracehook.h inlines. This also lifts the calls for tracing out of the binfmt load_binary hooks into search_binary_handler() after it calls into the binfmt module. This change has no effect, since all the binfmt modules' load_binary functions did the call at the end on success, and now search_binary_handler() does it immediately after return if successful. We consolidate the repeated code, and binfmt modules no longer need to import ptrace_notify(). Signed-off-by: Roland McGrath <roland@redhat.com> Cc: Oleg Nesterov <oleg@tv-sign.ru> Reviewed-by: Ingo Molnar <mingo@elte.hu> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
This commit is contained in:
committed by
Linus Torvalds
parent
88ac2921a7
commit
6341c393fc
@@ -1003,12 +1003,6 @@ static int load_elf_binary(struct linux_binprm *bprm, struct pt_regs *regs)
|
||||
#endif
|
||||
|
||||
start_thread(regs, elf_entry, bprm->p);
|
||||
if (unlikely(current->ptrace & PT_PTRACED)) {
|
||||
if (current->ptrace & PT_TRACE_EXEC)
|
||||
ptrace_notify ((PTRACE_EVENT_EXEC << 8) | SIGTRAP);
|
||||
else
|
||||
send_sig(SIGTRAP, current, 0);
|
||||
}
|
||||
retval = 0;
|
||||
out:
|
||||
kfree(loc);
|
||||
|
Reference in New Issue
Block a user