aboutsummaryrefslogtreecommitdiff
path: root/arch/sh/kernel/ptrace_32.c
diff options
context:
space:
mode:
authorPaul Mundt <lethal@linux-sh.org>2008-07-30 20:05:35 +0900
committerPaul Mundt <lethal@linux-sh.org>2008-08-02 04:39:33 +0900
commit9e5e21170e4de269cd5b9d53ac9d60d220e3be63 (patch)
treed719e40aa41897b306c4925c37a0d83579966a87 /arch/sh/kernel/ptrace_32.c
parentab99c733ae73cce31f2a2434f7099564e5a73d95 (diff)
sh: Fix up the audit arch endian specification.
Presently this was always being set to AUDIT_ARCH_SH, which assumes big endian. Fix this up so that the architecture actually reflects what we're running on. Signed-off-by: Paul Mundt <lethal@linux-sh.org>
Diffstat (limited to 'arch/sh/kernel/ptrace_32.c')
-rw-r--r--arch/sh/kernel/ptrace_32.c13
1 files changed, 12 insertions, 1 deletions
diff --git a/arch/sh/kernel/ptrace_32.c b/arch/sh/kernel/ptrace_32.c
index f48769b23bd..035cb300d3d 100644
--- a/arch/sh/kernel/ptrace_32.c
+++ b/arch/sh/kernel/ptrace_32.c
@@ -217,6 +217,17 @@ long arch_ptrace(struct task_struct *child, long request, long addr, long data)
return ret;
}
+static inline int audit_arch(void)
+{
+ int arch = EM_SH;
+
+#ifdef CONFIG_CPU_LITTLE_ENDIAN
+ arch |= __AUDIT_ARCH_LE;
+#endif
+
+ return arch;
+}
+
asmlinkage long do_syscall_trace_enter(struct pt_regs *regs)
{
long ret = 0;
@@ -233,7 +244,7 @@ asmlinkage long do_syscall_trace_enter(struct pt_regs *regs)
ret = -1L;
if (unlikely(current->audit_context))
- audit_syscall_entry(AUDIT_ARCH_SH, regs->regs[3],
+ audit_syscall_entry(audit_arch(), regs->regs[3],
regs->regs[4], regs->regs[5],
regs->regs[6], regs->regs[7]);