diff options
Diffstat (limited to 'arch')
-rw-r--r-- | arch/sh/kernel/ptrace_32.c | 13 | ||||
-rw-r--r-- | arch/sh/kernel/ptrace_64.c | 16 |
2 files changed, 27 insertions, 2 deletions
diff --git a/arch/sh/kernel/ptrace_32.c b/arch/sh/kernel/ptrace_32.c index f48769b23bd6..035cb300d3dc 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) | |||
217 | return ret; | 217 | return ret; |
218 | } | 218 | } |
219 | 219 | ||
220 | static inline int audit_arch(void) | ||
221 | { | ||
222 | int arch = EM_SH; | ||
223 | |||
224 | #ifdef CONFIG_CPU_LITTLE_ENDIAN | ||
225 | arch |= __AUDIT_ARCH_LE; | ||
226 | #endif | ||
227 | |||
228 | return arch; | ||
229 | } | ||
230 | |||
220 | asmlinkage long do_syscall_trace_enter(struct pt_regs *regs) | 231 | asmlinkage long do_syscall_trace_enter(struct pt_regs *regs) |
221 | { | 232 | { |
222 | long ret = 0; | 233 | long ret = 0; |
@@ -233,7 +244,7 @@ asmlinkage long do_syscall_trace_enter(struct pt_regs *regs) | |||
233 | ret = -1L; | 244 | ret = -1L; |
234 | 245 | ||
235 | if (unlikely(current->audit_context)) | 246 | if (unlikely(current->audit_context)) |
236 | audit_syscall_entry(AUDIT_ARCH_SH, regs->regs[3], | 247 | audit_syscall_entry(audit_arch(), regs->regs[3], |
237 | regs->regs[4], regs->regs[5], | 248 | regs->regs[4], regs->regs[5], |
238 | regs->regs[6], regs->regs[7]); | 249 | regs->regs[6], regs->regs[7]); |
239 | 250 | ||
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 | ||
225 | static 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 | |||
225 | asmlinkage long long do_syscall_trace_enter(struct pt_regs *regs) | 239 | asmlinkage 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 | ||