aboutsummaryrefslogtreecommitdiffstats
path: root/arch/s390/kernel/ptrace.c
diff options
context:
space:
mode:
authorHeiko Carstens <heiko.carstens@de.ibm.com>2009-06-12 04:26:25 -0400
committerMartin Schwidefsky <schwidefsky@de.ibm.com>2009-06-12 04:27:30 -0400
commit7757591ab4a36314a258e181dbf0994415c288c2 (patch)
tree99b414c90dbc7889f7738a795122805f167a00af /arch/s390/kernel/ptrace.c
parentd90cbd469c9c7c1494fc2084af9319e6a557368b (diff)
[S390] implement is_compat_task
Implement is_compat_task and use it all over the place. Signed-off-by: Heiko Carstens <heiko.carstens@de.ibm.com> Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
Diffstat (limited to 'arch/s390/kernel/ptrace.c')
-rw-r--r--arch/s390/kernel/ptrace.c12
1 files changed, 5 insertions, 7 deletions
diff --git a/arch/s390/kernel/ptrace.c b/arch/s390/kernel/ptrace.c
index 75c496f4f16d..99eef179e903 100644
--- a/arch/s390/kernel/ptrace.c
+++ b/arch/s390/kernel/ptrace.c
@@ -36,7 +36,7 @@
36#include <linux/elf.h> 36#include <linux/elf.h>
37#include <linux/regset.h> 37#include <linux/regset.h>
38#include <linux/tracehook.h> 38#include <linux/tracehook.h>
39 39#include <linux/compat.h>
40#include <asm/segment.h> 40#include <asm/segment.h>
41#include <asm/page.h> 41#include <asm/page.h>
42#include <asm/pgtable.h> 42#include <asm/pgtable.h>
@@ -69,7 +69,7 @@ FixPerRegisters(struct task_struct *task)
69 if (per_info->single_step) { 69 if (per_info->single_step) {
70 per_info->control_regs.bits.starting_addr = 0; 70 per_info->control_regs.bits.starting_addr = 0;
71#ifdef CONFIG_COMPAT 71#ifdef CONFIG_COMPAT
72 if (test_thread_flag(TIF_31BIT)) 72 if (is_compat_task())
73 per_info->control_regs.bits.ending_addr = 0x7fffffffUL; 73 per_info->control_regs.bits.ending_addr = 0x7fffffffUL;
74 else 74 else
75#endif 75#endif
@@ -482,8 +482,7 @@ static int peek_user_compat(struct task_struct *child,
482{ 482{
483 __u32 tmp; 483 __u32 tmp;
484 484
485 if (!test_thread_flag(TIF_31BIT) || 485 if (!is_compat_task() || (addr & 3) || addr > sizeof(struct user) - 3)
486 (addr & 3) || addr > sizeof(struct user) - 3)
487 return -EIO; 486 return -EIO;
488 487
489 tmp = __peek_user_compat(child, addr); 488 tmp = __peek_user_compat(child, addr);
@@ -584,8 +583,7 @@ static int __poke_user_compat(struct task_struct *child,
584static int poke_user_compat(struct task_struct *child, 583static int poke_user_compat(struct task_struct *child,
585 addr_t addr, addr_t data) 584 addr_t addr, addr_t data)
586{ 585{
587 if (!test_thread_flag(TIF_31BIT) || 586 if (!is_compat_task() || (addr & 3) || addr > sizeof(struct user32) - 3)
588 (addr & 3) || addr > sizeof(struct user32) - 3)
589 return -EIO; 587 return -EIO;
590 588
591 return __poke_user_compat(child, addr, data); 589 return __poke_user_compat(child, addr, data);
@@ -660,7 +658,7 @@ asmlinkage long do_syscall_trace_enter(struct pt_regs *regs)
660 } 658 }
661 659
662 if (unlikely(current->audit_context)) 660 if (unlikely(current->audit_context))
663 audit_syscall_entry(test_thread_flag(TIF_31BIT) ? 661 audit_syscall_entry(is_compat_task() ?
664 AUDIT_ARCH_S390 : AUDIT_ARCH_S390X, 662 AUDIT_ARCH_S390 : AUDIT_ARCH_S390X,
665 regs->gprs[2], regs->orig_gpr2, 663 regs->gprs[2], regs->orig_gpr2,
666 regs->gprs[3], regs->gprs[4], 664 regs->gprs[3], regs->gprs[4],