diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2012-01-17 19:06:51 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2012-01-17 19:41:31 -0500 |
commit | f429ee3b808118591d1f3cdf3c0d0793911a5677 (patch) | |
tree | 96d848f5f677d96758ecd2aee5eb6931b75bf218 /arch/powerpc | |
parent | 22b4eb5e3174efb49791c62823d0cccc35394c36 (diff) | |
parent | c158a35c8a681cf68d36f22f058f9f5466386c71 (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/powerpc')
-rw-r--r-- | arch/powerpc/include/asm/ptrace.h | 13 | ||||
-rw-r--r-- | arch/powerpc/kernel/ptrace.c | 30 |
2 files changed, 25 insertions, 18 deletions
diff --git a/arch/powerpc/include/asm/ptrace.h b/arch/powerpc/include/asm/ptrace.h index 48223f9b8728..78a205162fd7 100644 --- a/arch/powerpc/include/asm/ptrace.h +++ b/arch/powerpc/include/asm/ptrace.h | |||
@@ -86,7 +86,18 @@ struct pt_regs { | |||
86 | #define instruction_pointer(regs) ((regs)->nip) | 86 | #define instruction_pointer(regs) ((regs)->nip) |
87 | #define user_stack_pointer(regs) ((regs)->gpr[1]) | 87 | #define user_stack_pointer(regs) ((regs)->gpr[1]) |
88 | #define kernel_stack_pointer(regs) ((regs)->gpr[1]) | 88 | #define kernel_stack_pointer(regs) ((regs)->gpr[1]) |
89 | #define regs_return_value(regs) ((regs)->gpr[3]) | 89 | static inline int is_syscall_success(struct pt_regs *regs) |
90 | { | ||
91 | return !(regs->ccr & 0x10000000); | ||
92 | } | ||
93 | |||
94 | static inline long regs_return_value(struct pt_regs *regs) | ||
95 | { | ||
96 | if (is_syscall_success(regs)) | ||
97 | return regs->gpr[3]; | ||
98 | else | ||
99 | return -regs->gpr[3]; | ||
100 | } | ||
90 | 101 | ||
91 | #ifdef CONFIG_SMP | 102 | #ifdef CONFIG_SMP |
92 | extern unsigned long profile_pc(struct pt_regs *regs); | 103 | extern unsigned long profile_pc(struct pt_regs *regs); |
diff --git a/arch/powerpc/kernel/ptrace.c b/arch/powerpc/kernel/ptrace.c index 5de73dbd15c7..5b43325402bc 100644 --- a/arch/powerpc/kernel/ptrace.c +++ b/arch/powerpc/kernel/ptrace.c | |||
@@ -1724,22 +1724,20 @@ long do_syscall_trace_enter(struct pt_regs *regs) | |||
1724 | if (unlikely(test_thread_flag(TIF_SYSCALL_TRACEPOINT))) | 1724 | if (unlikely(test_thread_flag(TIF_SYSCALL_TRACEPOINT))) |
1725 | trace_sys_enter(regs, regs->gpr[0]); | 1725 | trace_sys_enter(regs, regs->gpr[0]); |
1726 | 1726 | ||
1727 | if (unlikely(current->audit_context)) { | ||
1728 | #ifdef CONFIG_PPC64 | 1727 | #ifdef CONFIG_PPC64 |
1729 | if (!is_32bit_task()) | 1728 | if (!is_32bit_task()) |
1730 | audit_syscall_entry(AUDIT_ARCH_PPC64, | 1729 | audit_syscall_entry(AUDIT_ARCH_PPC64, |
1731 | regs->gpr[0], | 1730 | regs->gpr[0], |
1732 | regs->gpr[3], regs->gpr[4], | 1731 | regs->gpr[3], regs->gpr[4], |
1733 | regs->gpr[5], regs->gpr[6]); | 1732 | regs->gpr[5], regs->gpr[6]); |
1734 | else | 1733 | else |
1735 | #endif | 1734 | #endif |
1736 | audit_syscall_entry(AUDIT_ARCH_PPC, | 1735 | audit_syscall_entry(AUDIT_ARCH_PPC, |
1737 | regs->gpr[0], | 1736 | regs->gpr[0], |
1738 | regs->gpr[3] & 0xffffffff, | 1737 | regs->gpr[3] & 0xffffffff, |
1739 | regs->gpr[4] & 0xffffffff, | 1738 | regs->gpr[4] & 0xffffffff, |
1740 | regs->gpr[5] & 0xffffffff, | 1739 | regs->gpr[5] & 0xffffffff, |
1741 | regs->gpr[6] & 0xffffffff); | 1740 | regs->gpr[6] & 0xffffffff); |
1742 | } | ||
1743 | 1741 | ||
1744 | return ret ?: regs->gpr[0]; | 1742 | return ret ?: regs->gpr[0]; |
1745 | } | 1743 | } |
@@ -1748,9 +1746,7 @@ void do_syscall_trace_leave(struct pt_regs *regs) | |||
1748 | { | 1746 | { |
1749 | int step; | 1747 | int step; |
1750 | 1748 | ||
1751 | if (unlikely(current->audit_context)) | 1749 | audit_syscall_exit(regs); |
1752 | audit_syscall_exit((regs->ccr&0x10000000)?AUDITSC_FAILURE:AUDITSC_SUCCESS, | ||
1753 | regs->result); | ||
1754 | 1750 | ||
1755 | if (unlikely(test_thread_flag(TIF_SYSCALL_TRACEPOINT))) | 1751 | if (unlikely(test_thread_flag(TIF_SYSCALL_TRACEPOINT))) |
1756 | trace_sys_exit(regs, regs->result); | 1752 | trace_sys_exit(regs, regs->result); |