diff options
author | Tony Luck <tony.luck@intel.com> | 2005-06-20 12:35:34 -0400 |
---|---|---|
committer | Tony Luck <tony.luck@intel.com> | 2005-06-20 12:35:34 -0400 |
commit | 8ba08378b479f472b37b83542c31bdad465033cf (patch) | |
tree | f4421227b3065e786c9041cf0ce0073a249e011b /arch/ppc/kernel | |
parent | 34b727c135ff651f153be5757056d25678b6d018 (diff) | |
parent | 8b22c249e7de453961e4d253b19fc2a0bdd65d53 (diff) |
Auto merge with /home/aegl/GIT/linus
Diffstat (limited to 'arch/ppc/kernel')
-rw-r--r-- | arch/ppc/kernel/entry.S | 16 | ||||
-rw-r--r-- | arch/ppc/kernel/ppc_ksyms.c | 2 | ||||
-rw-r--r-- | arch/ppc/kernel/ptrace.c | 40 |
3 files changed, 45 insertions, 13 deletions
diff --git a/arch/ppc/kernel/entry.S b/arch/ppc/kernel/entry.S index 5f075dbc4ee7..661523707e8c 100644 --- a/arch/ppc/kernel/entry.S +++ b/arch/ppc/kernel/entry.S | |||
@@ -202,7 +202,7 @@ _GLOBAL(DoSyscall) | |||
202 | rlwinm r11,r11,0,~_TIFL_FORCE_NOERROR | 202 | rlwinm r11,r11,0,~_TIFL_FORCE_NOERROR |
203 | stw r11,TI_LOCAL_FLAGS(r10) | 203 | stw r11,TI_LOCAL_FLAGS(r10) |
204 | lwz r11,TI_FLAGS(r10) | 204 | lwz r11,TI_FLAGS(r10) |
205 | andi. r11,r11,_TIF_SYSCALL_TRACE | 205 | andi. r11,r11,_TIF_SYSCALL_T_OR_A |
206 | bne- syscall_dotrace | 206 | bne- syscall_dotrace |
207 | syscall_dotrace_cont: | 207 | syscall_dotrace_cont: |
208 | cmplwi 0,r0,NR_syscalls | 208 | cmplwi 0,r0,NR_syscalls |
@@ -237,7 +237,7 @@ ret_from_syscall: | |||
237 | SYNC | 237 | SYNC |
238 | MTMSRD(r10) | 238 | MTMSRD(r10) |
239 | lwz r9,TI_FLAGS(r12) | 239 | lwz r9,TI_FLAGS(r12) |
240 | andi. r0,r9,(_TIF_SYSCALL_TRACE|_TIF_SIGPENDING|_TIF_NEED_RESCHED) | 240 | andi. r0,r9,(_TIF_SYSCALL_T_OR_A|_TIF_SIGPENDING|_TIF_NEED_RESCHED) |
241 | bne- syscall_exit_work | 241 | bne- syscall_exit_work |
242 | syscall_exit_cont: | 242 | syscall_exit_cont: |
243 | #if defined(CONFIG_4xx) || defined(CONFIG_BOOKE) | 243 | #if defined(CONFIG_4xx) || defined(CONFIG_BOOKE) |
@@ -277,7 +277,8 @@ syscall_dotrace: | |||
277 | SAVE_NVGPRS(r1) | 277 | SAVE_NVGPRS(r1) |
278 | li r0,0xc00 | 278 | li r0,0xc00 |
279 | stw r0,TRAP(r1) | 279 | stw r0,TRAP(r1) |
280 | bl do_syscall_trace | 280 | addi r3,r1,STACK_FRAME_OVERHEAD |
281 | bl do_syscall_trace_enter | ||
281 | lwz r0,GPR0(r1) /* Restore original registers */ | 282 | lwz r0,GPR0(r1) /* Restore original registers */ |
282 | lwz r3,GPR3(r1) | 283 | lwz r3,GPR3(r1) |
283 | lwz r4,GPR4(r1) | 284 | lwz r4,GPR4(r1) |
@@ -291,7 +292,7 @@ syscall_dotrace: | |||
291 | syscall_exit_work: | 292 | syscall_exit_work: |
292 | stw r6,RESULT(r1) /* Save result */ | 293 | stw r6,RESULT(r1) /* Save result */ |
293 | stw r3,GPR3(r1) /* Update return value */ | 294 | stw r3,GPR3(r1) /* Update return value */ |
294 | andi. r0,r9,_TIF_SYSCALL_TRACE | 295 | andi. r0,r9,_TIF_SYSCALL_T_OR_A |
295 | beq 5f | 296 | beq 5f |
296 | ori r10,r10,MSR_EE | 297 | ori r10,r10,MSR_EE |
297 | SYNC | 298 | SYNC |
@@ -303,7 +304,8 @@ syscall_exit_work: | |||
303 | li r4,0xc00 | 304 | li r4,0xc00 |
304 | stw r4,TRAP(r1) | 305 | stw r4,TRAP(r1) |
305 | 4: | 306 | 4: |
306 | bl do_syscall_trace | 307 | addi r3,r1,STACK_FRAME_OVERHEAD |
308 | bl do_syscall_trace_leave | ||
307 | REST_NVGPRS(r1) | 309 | REST_NVGPRS(r1) |
308 | 2: | 310 | 2: |
309 | lwz r3,GPR3(r1) | 311 | lwz r3,GPR3(r1) |
@@ -627,8 +629,8 @@ sigreturn_exit: | |||
627 | subi r1,r3,STACK_FRAME_OVERHEAD | 629 | subi r1,r3,STACK_FRAME_OVERHEAD |
628 | rlwinm r12,r1,0,0,18 /* current_thread_info() */ | 630 | rlwinm r12,r1,0,0,18 /* current_thread_info() */ |
629 | lwz r9,TI_FLAGS(r12) | 631 | lwz r9,TI_FLAGS(r12) |
630 | andi. r0,r9,_TIF_SYSCALL_TRACE | 632 | andi. r0,r9,_TIF_SYSCALL_T_OR_A |
631 | bnel- do_syscall_trace | 633 | bnel- do_syscall_trace_leave |
632 | /* fall through */ | 634 | /* fall through */ |
633 | 635 | ||
634 | .globl ret_from_except_full | 636 | .globl ret_from_except_full |
diff --git a/arch/ppc/kernel/ppc_ksyms.c b/arch/ppc/kernel/ppc_ksyms.c index 2ccb58fe4fc3..d59ad07de8e7 100644 --- a/arch/ppc/kernel/ppc_ksyms.c +++ b/arch/ppc/kernel/ppc_ksyms.c | |||
@@ -55,7 +55,6 @@ | |||
55 | #define EXPORT_SYMTAB_STROPS | 55 | #define EXPORT_SYMTAB_STROPS |
56 | 56 | ||
57 | extern void transfer_to_handler(void); | 57 | extern void transfer_to_handler(void); |
58 | extern void do_syscall_trace(void); | ||
59 | extern void do_IRQ(struct pt_regs *regs); | 58 | extern void do_IRQ(struct pt_regs *regs); |
60 | extern void MachineCheckException(struct pt_regs *regs); | 59 | extern void MachineCheckException(struct pt_regs *regs); |
61 | extern void AlignmentException(struct pt_regs *regs); | 60 | extern void AlignmentException(struct pt_regs *regs); |
@@ -74,7 +73,6 @@ extern unsigned long mm_ptov (unsigned long paddr); | |||
74 | EXPORT_SYMBOL(clear_pages); | 73 | EXPORT_SYMBOL(clear_pages); |
75 | EXPORT_SYMBOL(clear_user_page); | 74 | EXPORT_SYMBOL(clear_user_page); |
76 | EXPORT_SYMBOL(do_signal); | 75 | EXPORT_SYMBOL(do_signal); |
77 | EXPORT_SYMBOL(do_syscall_trace); | ||
78 | EXPORT_SYMBOL(transfer_to_handler); | 76 | EXPORT_SYMBOL(transfer_to_handler); |
79 | EXPORT_SYMBOL(do_IRQ); | 77 | EXPORT_SYMBOL(do_IRQ); |
80 | EXPORT_SYMBOL(MachineCheckException); | 78 | EXPORT_SYMBOL(MachineCheckException); |
diff --git a/arch/ppc/kernel/ptrace.c b/arch/ppc/kernel/ptrace.c index 59d59a8dc249..e7aee4108dea 100644 --- a/arch/ppc/kernel/ptrace.c +++ b/arch/ppc/kernel/ptrace.c | |||
@@ -27,6 +27,9 @@ | |||
27 | #include <linux/user.h> | 27 | #include <linux/user.h> |
28 | #include <linux/security.h> | 28 | #include <linux/security.h> |
29 | #include <linux/signal.h> | 29 | #include <linux/signal.h> |
30 | #include <linux/seccomp.h> | ||
31 | #include <linux/audit.h> | ||
32 | #include <linux/module.h> | ||
30 | 33 | ||
31 | #include <asm/uaccess.h> | 34 | #include <asm/uaccess.h> |
32 | #include <asm/page.h> | 35 | #include <asm/page.h> |
@@ -455,11 +458,10 @@ out: | |||
455 | return ret; | 458 | return ret; |
456 | } | 459 | } |
457 | 460 | ||
458 | void do_syscall_trace(void) | 461 | static void do_syscall_trace(void) |
459 | { | 462 | { |
460 | if (!test_thread_flag(TIF_SYSCALL_TRACE) | 463 | /* the 0x80 provides a way for the tracing parent to distinguish |
461 | || !(current->ptrace & PT_PTRACED)) | 464 | between a syscall stop and SIGTRAP delivery */ |
462 | return; | ||
463 | ptrace_notify(SIGTRAP | ((current->ptrace & PT_TRACESYSGOOD) | 465 | ptrace_notify(SIGTRAP | ((current->ptrace & PT_TRACESYSGOOD) |
464 | ? 0x80 : 0)); | 466 | ? 0x80 : 0)); |
465 | 467 | ||
@@ -473,3 +475,33 @@ void do_syscall_trace(void) | |||
473 | current->exit_code = 0; | 475 | current->exit_code = 0; |
474 | } | 476 | } |
475 | } | 477 | } |
478 | |||
479 | void do_syscall_trace_enter(struct pt_regs *regs) | ||
480 | { | ||
481 | if (test_thread_flag(TIF_SYSCALL_TRACE) | ||
482 | && (current->ptrace & PT_PTRACED)) | ||
483 | do_syscall_trace(); | ||
484 | |||
485 | if (unlikely(current->audit_context)) | ||
486 | audit_syscall_entry(current, AUDIT_ARCH_PPC, | ||
487 | regs->gpr[0], | ||
488 | regs->gpr[3], regs->gpr[4], | ||
489 | regs->gpr[5], regs->gpr[6]); | ||
490 | } | ||
491 | |||
492 | void do_syscall_trace_leave(struct pt_regs *regs) | ||
493 | { | ||
494 | secure_computing(regs->gpr[0]); | ||
495 | |||
496 | if (unlikely(current->audit_context)) | ||
497 | audit_syscall_exit(current, | ||
498 | (regs->ccr&0x1000)?AUDITSC_FAILURE:AUDITSC_SUCCESS, | ||
499 | regs->result); | ||
500 | |||
501 | if ((test_thread_flag(TIF_SYSCALL_TRACE)) | ||
502 | && (current->ptrace & PT_PTRACED)) | ||
503 | do_syscall_trace(); | ||
504 | } | ||
505 | |||
506 | EXPORT_SYMBOL(do_syscall_trace_enter); | ||
507 | EXPORT_SYMBOL(do_syscall_trace_leave); | ||