diff options
Diffstat (limited to 'arch/sh/kernel/ptrace_64.c')
-rw-r--r-- | arch/sh/kernel/ptrace_64.c | 38 |
1 files changed, 24 insertions, 14 deletions
diff --git a/arch/sh/kernel/ptrace_64.c b/arch/sh/kernel/ptrace_64.c index e9cc6ebd2cea..f6fbdfa6876d 100644 --- a/arch/sh/kernel/ptrace_64.c +++ b/arch/sh/kernel/ptrace_64.c | |||
@@ -1,12 +1,8 @@ | |||
1 | /* | 1 | /* |
2 | * This file is subject to the terms and conditions of the GNU General Public | 2 | * arch/sh/kernel/ptrace_64.c |
3 | * License. See the file "COPYING" in the main directory of this archive | ||
4 | * for more details. | ||
5 | * | ||
6 | * arch/sh64/kernel/ptrace.c | ||
7 | * | 3 | * |
8 | * Copyright (C) 2000, 2001 Paolo Alberelli | 4 | * Copyright (C) 2000, 2001 Paolo Alberelli |
9 | * Copyright (C) 2003 Paul Mundt | 5 | * Copyright (C) 2003 - 2007 Paul Mundt |
10 | * | 6 | * |
11 | * Started from SH3/4 version: | 7 | * Started from SH3/4 version: |
12 | * SuperH version: Copyright (C) 1999, 2000 Kaz Kojima & Niibe Yutaka | 8 | * SuperH version: Copyright (C) 1999, 2000 Kaz Kojima & Niibe Yutaka |
@@ -15,8 +11,10 @@ | |||
15 | * By Ross Biro 1/23/92 | 11 | * By Ross Biro 1/23/92 |
16 | * edited by Linus Torvalds | 12 | * edited by Linus Torvalds |
17 | * | 13 | * |
14 | * This file is subject to the terms and conditions of the GNU General Public | ||
15 | * License. See the file "COPYING" in the main directory of this archive | ||
16 | * for more details. | ||
18 | */ | 17 | */ |
19 | |||
20 | #include <linux/kernel.h> | 18 | #include <linux/kernel.h> |
21 | #include <linux/rwsem.h> | 19 | #include <linux/rwsem.h> |
22 | #include <linux/sched.h> | 20 | #include <linux/sched.h> |
@@ -28,7 +26,7 @@ | |||
28 | #include <linux/user.h> | 26 | #include <linux/user.h> |
29 | #include <linux/signal.h> | 27 | #include <linux/signal.h> |
30 | #include <linux/syscalls.h> | 28 | #include <linux/syscalls.h> |
31 | 29 | #include <linux/audit.h> | |
32 | #include <asm/io.h> | 30 | #include <asm/io.h> |
33 | #include <asm/uaccess.h> | 31 | #include <asm/uaccess.h> |
34 | #include <asm/pgtable.h> | 32 | #include <asm/pgtable.h> |
@@ -274,17 +272,23 @@ asmlinkage int sh64_ptrace(long request, long pid, long addr, long data) | |||
274 | return sys_ptrace(request, pid, addr, data); | 272 | return sys_ptrace(request, pid, addr, data); |
275 | } | 273 | } |
276 | 274 | ||
277 | asmlinkage void syscall_trace(void) | 275 | asmlinkage void syscall_trace(struct pt_regs *regs, int entryexit) |
278 | { | 276 | { |
279 | struct task_struct *tsk = current; | 277 | struct task_struct *tsk = current; |
280 | 278 | ||
281 | if (!test_thread_flag(TIF_SYSCALL_TRACE)) | 279 | if (unlikely(current->audit_context) && entryexit) |
282 | return; | 280 | audit_syscall_exit(AUDITSC_RESULT(regs->regs[9]), |
281 | regs->regs[9]); | ||
282 | |||
283 | if (!test_thread_flag(TIF_SYSCALL_TRACE) && | ||
284 | !test_thread_flag(TIF_SINGLESTEP)) | ||
285 | goto out; | ||
283 | if (!(tsk->ptrace & PT_PTRACED)) | 286 | if (!(tsk->ptrace & PT_PTRACED)) |
284 | return; | 287 | goto out; |
288 | |||
289 | ptrace_notify(SIGTRAP | ((current->ptrace & PT_TRACESYSGOOD) && | ||
290 | !test_thread_flag(TIF_SINGLESTEP) ? 0x80 : 0)); | ||
285 | 291 | ||
286 | ptrace_notify(SIGTRAP | ((current->ptrace & PT_TRACESYSGOOD) | ||
287 | ? 0x80 : 0)); | ||
288 | /* | 292 | /* |
289 | * this isn't the same as continuing with a signal, but it will do | 293 | * this isn't the same as continuing with a signal, but it will do |
290 | * for normal use. strace only continues with a signal if the | 294 | * for normal use. strace only continues with a signal if the |
@@ -294,6 +298,12 @@ asmlinkage void syscall_trace(void) | |||
294 | send_sig(tsk->exit_code, tsk, 1); | 298 | send_sig(tsk->exit_code, tsk, 1); |
295 | tsk->exit_code = 0; | 299 | tsk->exit_code = 0; |
296 | } | 300 | } |
301 | |||
302 | out: | ||
303 | if (unlikely(current->audit_context) && !entryexit) | ||
304 | audit_syscall_entry(AUDIT_ARCH_SH, regs->regs[1], | ||
305 | regs->regs[2], regs->regs[3], | ||
306 | regs->regs[4], regs->regs[5]); | ||
297 | } | 307 | } |
298 | 308 | ||
299 | /* Called with interrupts disabled */ | 309 | /* Called with interrupts disabled */ |