aboutsummaryrefslogtreecommitdiffstats
path: root/arch/sh/kernel/ptrace_64.c
diff options
context:
space:
mode:
authorPaul Mundt <lethal@linux-sh.org>2008-07-30 07:05:35 -0400
committerPaul Mundt <lethal@linux-sh.org>2008-08-01 15:39:33 -0400
commit9e5e21170e4de269cd5b9d53ac9d60d220e3be63 (patch)
treed719e40aa41897b306c4925c37a0d83579966a87 /arch/sh/kernel/ptrace_64.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_64.c')
-rw-r--r--arch/sh/kernel/ptrace_64.c16
1 files changed, 15 insertions, 1 deletions
diff --git a/arch/sh/kernel/ptrace_64.c b/arch/sh/kernel/ptrace_64.c
index 236d8bef9ccd..5922edd416db 100644
--- a/arch/sh/kernel/ptrace_64.c
+++ b/arch/sh/kernel/ptrace_64.c
@@ -222,6 +222,20 @@ asmlinkage int sh64_ptrace(long request, long pid, long addr, long data)
222 return sys_ptrace(request, pid, addr, data); 222 return sys_ptrace(request, pid, addr, data);
223} 223}
224 224
225static inline int audit_arch(void)
226{
227 int arch = EM_SH;
228
229#ifdef CONFIG_64BIT
230 arch |= __AUDIT_ARCH_64BIT;
231#endif
232#ifdef CONFIG_CPU_LITTLE_ENDIAN
233 arch |= __AUDIT_ARCH_LE;
234#endif
235
236 return arch;
237}
238
225asmlinkage long long do_syscall_trace_enter(struct pt_regs *regs) 239asmlinkage long long do_syscall_trace_enter(struct pt_regs *regs)
226{ 240{
227 long long ret = 0; 241 long long ret = 0;
@@ -238,7 +252,7 @@ asmlinkage long long do_syscall_trace_enter(struct pt_regs *regs)
238 ret = -1LL; 252 ret = -1LL;
239 253
240 if (unlikely(current->audit_context)) 254 if (unlikely(current->audit_context))
241 audit_syscall_entry(AUDIT_ARCH_SH, regs->regs[1], 255 audit_syscall_entry(audit_arch(), regs->regs[1],
242 regs->regs[2], regs->regs[3], 256 regs->regs[2], regs->regs[3],
243 regs->regs[4], regs->regs[5]); 257 regs->regs[4], regs->regs[5]);
244 258