ptrace.c (1809de7e7d37c585e01a1bcc583ea92b78fc759d) ptrace.c (910cd32e552ea09caa89cdbe328e468979b030dd)
1/*
2 * Kernel support for the ptrace() and syscall tracing interfaces.
3 *
4 * Copyright (C) 2000 Hewlett-Packard Co, Linuxcare Inc.
5 * Copyright (C) 2000 Matthew Wilcox <matthew@wil.cx>
6 * Copyright (C) 2000 David Huggins-Daines <dhd@debian.org>
7 * Copyright (C) 2008 Helge Deller <deller@gmx.de>
8 */

--- 256 unchanged lines hidden (view full) ---

265
266 return ret;
267}
268#endif
269
270long do_syscall_trace_enter(struct pt_regs *regs)
271{
272 /* Do the secure computing check first. */
1/*
2 * Kernel support for the ptrace() and syscall tracing interfaces.
3 *
4 * Copyright (C) 2000 Hewlett-Packard Co, Linuxcare Inc.
5 * Copyright (C) 2000 Matthew Wilcox <matthew@wil.cx>
6 * Copyright (C) 2000 David Huggins-Daines <dhd@debian.org>
7 * Copyright (C) 2008 Helge Deller <deller@gmx.de>
8 */

--- 256 unchanged lines hidden (view full) ---

265
266 return ret;
267}
268#endif
269
270long do_syscall_trace_enter(struct pt_regs *regs)
271{
272 /* Do the secure computing check first. */
273 secure_computing_strict(regs->gr[20]);
273 if (secure_computing() == -1)
274 return -1;
274
275 if (test_thread_flag(TIF_SYSCALL_TRACE) &&
276 tracehook_report_syscall_entry(regs)) {
277 /*
278 * Tracing decided this syscall should not happen or the
279 * debugger stored an invalid system call number. Skip
280 * the system call and the system call restart handling.
281 */

--- 9 unchanged lines hidden (view full) ---

291#endif
292 audit_syscall_entry(regs->gr[20] & 0xffffffff,
293 regs->gr[26] & 0xffffffff,
294 regs->gr[25] & 0xffffffff,
295 regs->gr[24] & 0xffffffff,
296 regs->gr[23] & 0xffffffff);
297
298out:
275
276 if (test_thread_flag(TIF_SYSCALL_TRACE) &&
277 tracehook_report_syscall_entry(regs)) {
278 /*
279 * Tracing decided this syscall should not happen or the
280 * debugger stored an invalid system call number. Skip
281 * the system call and the system call restart handling.
282 */

--- 9 unchanged lines hidden (view full) ---

292#endif
293 audit_syscall_entry(regs->gr[20] & 0xffffffff,
294 regs->gr[26] & 0xffffffff,
295 regs->gr[25] & 0xffffffff,
296 regs->gr[24] & 0xffffffff,
297 regs->gr[23] & 0xffffffff);
298
299out:
299 return regs->gr[20];
300 /*
301 * Sign extend the syscall number to 64bit since it may have been
302 * modified by a compat ptrace call
303 */
304 return (int) ((u32) regs->gr[20]);
300}
301
302void do_syscall_trace_exit(struct pt_regs *regs)
303{
304 int stepping = test_thread_flag(TIF_SINGLESTEP) ||
305 test_thread_flag(TIF_BLOCKSTEP);
306
307 audit_syscall_exit(regs);
308
309 if (stepping || test_thread_flag(TIF_SYSCALL_TRACE))
310 tracehook_report_syscall_exit(regs, stepping);
311}
305}
306
307void do_syscall_trace_exit(struct pt_regs *regs)
308{
309 int stepping = test_thread_flag(TIF_SINGLESTEP) ||
310 test_thread_flag(TIF_BLOCKSTEP);
311
312 audit_syscall_exit(regs);
313
314 if (stepping || test_thread_flag(TIF_SYSCALL_TRACE))
315 tracehook_report_syscall_exit(regs, stepping);
316}