diff options
-rw-r--r-- | arch/powerpc/kernel/ptrace32.c | 33 | ||||
-rw-r--r-- | include/asm-powerpc/ptrace.h | 2 |
2 files changed, 7 insertions, 28 deletions
diff --git a/arch/powerpc/kernel/ptrace32.c b/arch/powerpc/kernel/ptrace32.c index 6612304e11e3..0f6eea086a23 100644 --- a/arch/powerpc/kernel/ptrace32.c +++ b/arch/powerpc/kernel/ptrace32.c | |||
@@ -85,33 +85,13 @@ static long compat_ptrace_old(struct task_struct *child, long request, | |||
85 | return ret; | 85 | return ret; |
86 | } | 86 | } |
87 | 87 | ||
88 | long compat_sys_ptrace(int request, int pid, unsigned long addr, | 88 | long compat_arch_ptrace(struct task_struct *child, compat_long_t request, |
89 | unsigned long data) | 89 | compat_ulong_t caddr, compat_ulong_t cdata) |
90 | { | 90 | { |
91 | struct task_struct *child; | 91 | unsigned long addr = caddr; |
92 | unsigned long data = cdata; | ||
92 | int ret; | 93 | int ret; |
93 | 94 | ||
94 | lock_kernel(); | ||
95 | if (request == PTRACE_TRACEME) { | ||
96 | ret = ptrace_traceme(); | ||
97 | goto out; | ||
98 | } | ||
99 | |||
100 | child = ptrace_get_task_struct(pid); | ||
101 | if (IS_ERR(child)) { | ||
102 | ret = PTR_ERR(child); | ||
103 | goto out; | ||
104 | } | ||
105 | |||
106 | if (request == PTRACE_ATTACH) { | ||
107 | ret = ptrace_attach(child); | ||
108 | goto out_tsk; | ||
109 | } | ||
110 | |||
111 | ret = ptrace_check_attach(child, request == PTRACE_KILL); | ||
112 | if (ret < 0) | ||
113 | goto out_tsk; | ||
114 | |||
115 | switch (request) { | 95 | switch (request) { |
116 | /* | 96 | /* |
117 | * Read 4 bytes of the other process' storage | 97 | * Read 4 bytes of the other process' storage |
@@ -375,9 +355,6 @@ long compat_sys_ptrace(int request, int pid, unsigned long addr, | |||
375 | ret = compat_ptrace_request(child, request, addr, data); | 355 | ret = compat_ptrace_request(child, request, addr, data); |
376 | break; | 356 | break; |
377 | } | 357 | } |
378 | out_tsk: | 358 | |
379 | put_task_struct(child); | ||
380 | out: | ||
381 | unlock_kernel(); | ||
382 | return ret; | 359 | return ret; |
383 | } | 360 | } |
diff --git a/include/asm-powerpc/ptrace.h b/include/asm-powerpc/ptrace.h index ffc150f602b8..891d68932f39 100644 --- a/include/asm-powerpc/ptrace.h +++ b/include/asm-powerpc/ptrace.h | |||
@@ -55,6 +55,8 @@ struct pt_regs { | |||
55 | 55 | ||
56 | #ifdef __powerpc64__ | 56 | #ifdef __powerpc64__ |
57 | 57 | ||
58 | #define __ARCH_WANT_COMPAT_SYS_PTRACE | ||
59 | |||
58 | #define STACK_FRAME_OVERHEAD 112 /* size of minimum stack frame */ | 60 | #define STACK_FRAME_OVERHEAD 112 /* size of minimum stack frame */ |
59 | 61 | ||
60 | /* Size of dummy stack frame allocated when calling signal handler. */ | 62 | /* Size of dummy stack frame allocated when calling signal handler. */ |