aboutsummaryrefslogtreecommitdiffstats
path: root/arch/mips
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2012-01-17 19:06:51 -0500
committerLinus Torvalds <torvalds@linux-foundation.org>2012-01-17 19:41:31 -0500
commitf429ee3b808118591d1f3cdf3c0d0793911a5677 (patch)
tree96d848f5f677d96758ecd2aee5eb6931b75bf218 /arch/mips
parent22b4eb5e3174efb49791c62823d0cccc35394c36 (diff)
parentc158a35c8a681cf68d36f22f058f9f5466386c71 (diff)
Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/audit
* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/audit: (29 commits) audit: no leading space in audit_log_d_path prefix audit: treat s_id as an untrusted string audit: fix signedness bug in audit_log_execve_info() audit: comparison on interprocess fields audit: implement all object interfield comparisons audit: allow interfield comparison between gid and ogid audit: complex interfield comparison helper audit: allow interfield comparison in audit rules Kernel: Audit Support For The ARM Platform audit: do not call audit_getname on error audit: only allow tasks to set their loginuid if it is -1 audit: remove task argument to audit_set_loginuid audit: allow audit matching on inode gid audit: allow matching on obj_uid audit: remove audit_finish_fork as it can't be called audit: reject entry,always rules audit: inline audit_free to simplify the look of generic code audit: drop audit_set_macxattr as it doesn't do anything audit: inline checks for not needing to collect aux records audit: drop some potentially inadvisable likely notations ... Use evil merge to fix up grammar mistakes in Kconfig file. Bad speling and horrible grammar (and copious swearing) is to be expected, but let's keep it to commit messages and comments, rather than expose it to users in config help texts or printouts.
Diffstat (limited to 'arch/mips')
-rw-r--r--arch/mips/include/asm/ptrace.h14
-rw-r--r--arch/mips/kernel/ptrace.c11
2 files changed, 17 insertions, 8 deletions
diff --git a/arch/mips/include/asm/ptrace.h b/arch/mips/include/asm/ptrace.h
index 7b99c670e478..4b7f5252d2fd 100644
--- a/arch/mips/include/asm/ptrace.h
+++ b/arch/mips/include/asm/ptrace.h
@@ -137,7 +137,19 @@ extern int ptrace_set_watch_regs(struct task_struct *child,
137 */ 137 */
138#define user_mode(regs) (((regs)->cp0_status & KU_MASK) == KU_USER) 138#define user_mode(regs) (((regs)->cp0_status & KU_MASK) == KU_USER)
139 139
140#define regs_return_value(_regs) ((_regs)->regs[2]) 140static inline int is_syscall_success(struct pt_regs *regs)
141{
142 return !regs->regs[7];
143}
144
145static inline long regs_return_value(struct pt_regs *regs)
146{
147 if (is_syscall_success(regs))
148 return regs->regs[2];
149 else
150 return -regs->regs[2];
151}
152
141#define instruction_pointer(regs) ((regs)->cp0_epc) 153#define instruction_pointer(regs) ((regs)->cp0_epc)
142#define profile_pc(regs) instruction_pointer(regs) 154#define profile_pc(regs) instruction_pointer(regs)
143 155
diff --git a/arch/mips/kernel/ptrace.c b/arch/mips/kernel/ptrace.c
index 4e6ea1ffad46..7786b608d932 100644
--- a/arch/mips/kernel/ptrace.c
+++ b/arch/mips/kernel/ptrace.c
@@ -560,10 +560,9 @@ asmlinkage void syscall_trace_enter(struct pt_regs *regs)
560 } 560 }
561 561
562out: 562out:
563 if (unlikely(current->audit_context)) 563 audit_syscall_entry(audit_arch(), regs->regs[2],
564 audit_syscall_entry(audit_arch(), regs->regs[2], 564 regs->regs[4], regs->regs[5],
565 regs->regs[4], regs->regs[5], 565 regs->regs[6], regs->regs[7]);
566 regs->regs[6], regs->regs[7]);
567} 566}
568 567
569/* 568/*
@@ -572,9 +571,7 @@ out:
572 */ 571 */
573asmlinkage void syscall_trace_leave(struct pt_regs *regs) 572asmlinkage void syscall_trace_leave(struct pt_regs *regs)
574{ 573{
575 if (unlikely(current->audit_context)) 574 audit_syscall_exit(regs);
576 audit_syscall_exit(AUDITSC_RESULT(regs->regs[7]),
577 -regs->regs[2]);
578 575
579 if (!(current->ptrace & PT_PTRACED)) 576 if (!(current->ptrace & PT_PTRACED))
580 return; 577 return;