summaryrefslogtreecommitdiffstats
path: root/arch/powerpc/kernel/ptrace.c
diff options
context:
space:
mode:
authorDavid Woodhouse <dwmw2@infradead.org>2007-01-14 02:38:18 +0100
committerPaul Mackerras <paulus@samba.org>2007-01-24 11:13:58 +0100
commitcfcd1705b61ecce1ab102b9593cf733fef314a19 (patch)
tree26ec97215dc25ae897af278a79b1f37303ff35a3 /arch/powerpc/kernel/ptrace.c
parent[POWERPC] Select DEFAULT_UIMAGE for HPC-NET/8641 (diff)
downloadlinux-cfcd1705b61ecce1ab102b9593cf733fef314a19.tar.xz
linux-cfcd1705b61ecce1ab102b9593cf733fef314a19.zip
[POWERPC] Mask 32-bit system call arguments to 32 bits on PPC64 in audit code
The system call entry code will clear the high bits of argument registers before invoking the system call; don't report whatever noise happens to be in the high bits of the register before that happens. Signed-off-by: David Woodhouse <dwmw2@infradead.org> Signed-off-by: Paul Mackerras <paulus@samba.org>
Diffstat (limited to 'arch/powerpc/kernel/ptrace.c')
-rw-r--r--arch/powerpc/kernel/ptrace.c24
1 files changed, 15 insertions, 9 deletions
diff --git a/arch/powerpc/kernel/ptrace.c b/arch/powerpc/kernel/ptrace.c
index 975102a020d9..cc44c7b975aa 100644
--- a/arch/powerpc/kernel/ptrace.c
+++ b/arch/powerpc/kernel/ptrace.c
@@ -532,16 +532,22 @@ void do_syscall_trace_enter(struct pt_regs *regs)
&& (current->ptrace & PT_PTRACED))
do_syscall_trace();
- if (unlikely(current->audit_context))
- audit_syscall_entry(
-#ifdef CONFIG_PPC32
- AUDIT_ARCH_PPC,
-#else
- test_thread_flag(TIF_32BIT)?AUDIT_ARCH_PPC:AUDIT_ARCH_PPC64,
+ if (unlikely(current->audit_context)) {
+#ifdef CONFIG_PPC64
+ if (!test_thread_flag(TIF_32BIT))
+ audit_syscall_entry(AUDIT_ARCH_PPC64,
+ regs->gpr[0],
+ regs->gpr[3], regs->gpr[4],
+ regs->gpr[5], regs->gpr[6]);
+ else
#endif
- regs->gpr[0],
- regs->gpr[3], regs->gpr[4],
- regs->gpr[5], regs->gpr[6]);
+ audit_syscall_entry(AUDIT_ARCH_PPC,
+ regs->gpr[0],
+ regs->gpr[3] & 0xffffffff,
+ regs->gpr[4] & 0xffffffff,
+ regs->gpr[5] & 0xffffffff,
+ regs->gpr[6] & 0xffffffff);
+ }
}
void do_syscall_trace_leave(struct pt_regs *regs)