Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 1 | /* |
| 2 | * This file is subject to the terms and conditions of the GNU General Public |
| 3 | * License. See the file "COPYING" in the main directory of this archive |
| 4 | * for more details. |
| 5 | * |
| 6 | * Copyright (C) 1992 Ross Biro |
| 7 | * Copyright (C) Linus Torvalds |
| 8 | * Copyright (C) 1994, 95, 96, 97, 98, 2000 Ralf Baechle |
| 9 | * Copyright (C) 1996 David S. Miller |
| 10 | * Kevin D. Kissell, kevink@mips.com and Carsten Langgaard, carstenl@mips.com |
| 11 | * Copyright (C) 1999 MIPS Technologies, Inc. |
| 12 | * Copyright (C) 2000 Ulf Carlsson |
| 13 | * |
| 14 | * At this time Linux/MIPS64 only supports syscall tracing, even for 32-bit |
| 15 | * binaries. |
| 16 | */ |
| 17 | #include <linux/compiler.h> |
| 18 | #include <linux/kernel.h> |
| 19 | #include <linux/sched.h> |
| 20 | #include <linux/mm.h> |
| 21 | #include <linux/errno.h> |
| 22 | #include <linux/ptrace.h> |
| 23 | #include <linux/smp.h> |
| 24 | #include <linux/smp_lock.h> |
| 25 | #include <linux/user.h> |
| 26 | #include <linux/security.h> |
| 27 | |
| 28 | #include <asm/cpu.h> |
Ralf Baechle | e50c0a8 | 2005-05-31 11:49:19 +0000 | [diff] [blame] | 29 | #include <asm/dsp.h> |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 30 | #include <asm/fpu.h> |
| 31 | #include <asm/mipsregs.h> |
Ralf Baechle | 101b353 | 2005-10-06 17:39:32 +0100 | [diff] [blame] | 32 | #include <asm/mipsmtregs.h> |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 33 | #include <asm/pgtable.h> |
| 34 | #include <asm/page.h> |
| 35 | #include <asm/system.h> |
| 36 | #include <asm/uaccess.h> |
| 37 | #include <asm/bootinfo.h> |
| 38 | |
Daniel Jacobowitz | ea3d710 | 2005-09-28 18:11:15 -0400 | [diff] [blame] | 39 | int ptrace_getregs (struct task_struct *child, __s64 __user *data); |
| 40 | int ptrace_setregs (struct task_struct *child, __s64 __user *data); |
| 41 | |
| 42 | int ptrace_getfpregs (struct task_struct *child, __u32 __user *data); |
| 43 | int ptrace_setfpregs (struct task_struct *child, __u32 __user *data); |
| 44 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 45 | /* |
| 46 | * Tracing a 32-bit process with a 64-bit strace and vice versa will not |
| 47 | * work. I don't know how to fix this. |
| 48 | */ |
| 49 | asmlinkage int sys32_ptrace(int request, int pid, int addr, int data) |
| 50 | { |
| 51 | struct task_struct *child; |
| 52 | int ret; |
| 53 | |
| 54 | #if 0 |
| 55 | printk("ptrace(r=%d,pid=%d,addr=%08lx,data=%08lx)\n", |
| 56 | (int) request, (int) pid, (unsigned long) addr, |
| 57 | (unsigned long) data); |
| 58 | #endif |
| 59 | lock_kernel(); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 60 | if (request == PTRACE_TRACEME) { |
Christoph Hellwig | 6b9c7ed | 2006-01-08 01:02:33 -0800 | [diff] [blame] | 61 | ret = ptrace_traceme(); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 62 | goto out; |
| 63 | } |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 64 | |
Christoph Hellwig | 6b9c7ed | 2006-01-08 01:02:33 -0800 | [diff] [blame] | 65 | child = ptrace_get_task_struct(pid); |
| 66 | if (IS_ERR(child)) { |
| 67 | ret = PTR_ERR(child); |
| 68 | goto out; |
| 69 | } |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 70 | |
| 71 | if (request == PTRACE_ATTACH) { |
| 72 | ret = ptrace_attach(child); |
| 73 | goto out_tsk; |
| 74 | } |
| 75 | |
| 76 | ret = ptrace_check_attach(child, request == PTRACE_KILL); |
| 77 | if (ret < 0) |
| 78 | goto out_tsk; |
| 79 | |
| 80 | switch (request) { |
| 81 | /* when I and D space are separate, these will need to be fixed. */ |
| 82 | case PTRACE_PEEKTEXT: /* read word at location addr. */ |
| 83 | case PTRACE_PEEKDATA: { |
| 84 | unsigned int tmp; |
| 85 | int copied; |
| 86 | |
| 87 | copied = access_process_vm(child, addr, &tmp, sizeof(tmp), 0); |
| 88 | ret = -EIO; |
| 89 | if (copied != sizeof(tmp)) |
| 90 | break; |
Atsushi Nemoto | 3055acb | 2006-01-29 22:34:32 +0900 | [diff] [blame] | 91 | ret = put_user(tmp, (unsigned int __user *) (unsigned long) data); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 92 | break; |
| 93 | } |
| 94 | |
Daniel Jacobowitz | ea3d710 | 2005-09-28 18:11:15 -0400 | [diff] [blame] | 95 | /* |
| 96 | * Read 4 bytes of the other process' storage |
| 97 | * data is a pointer specifying where the user wants the |
| 98 | * 4 bytes copied into |
| 99 | * addr is a pointer in the user's storage that contains an 8 byte |
| 100 | * address in the other process of the 4 bytes that is to be read |
| 101 | * (this is run in a 32-bit process looking at a 64-bit process) |
| 102 | * when I and D space are separate, these will need to be fixed. |
| 103 | */ |
| 104 | case PTRACE_PEEKTEXT_3264: |
| 105 | case PTRACE_PEEKDATA_3264: { |
| 106 | u32 tmp; |
| 107 | int copied; |
| 108 | u32 __user * addrOthers; |
| 109 | |
| 110 | ret = -EIO; |
| 111 | |
| 112 | /* Get the addr in the other process that we want to read */ |
| 113 | if (get_user(addrOthers, (u32 __user * __user *) (unsigned long) addr) != 0) |
| 114 | break; |
| 115 | |
| 116 | copied = access_process_vm(child, (u64)addrOthers, &tmp, |
| 117 | sizeof(tmp), 0); |
| 118 | if (copied != sizeof(tmp)) |
| 119 | break; |
| 120 | ret = put_user(tmp, (u32 __user *) (unsigned long) data); |
| 121 | break; |
| 122 | } |
| 123 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 124 | /* Read the word at location addr in the USER area. */ |
| 125 | case PTRACE_PEEKUSR: { |
| 126 | struct pt_regs *regs; |
| 127 | unsigned int tmp; |
| 128 | |
Al Viro | 40bc9c6 | 2006-01-12 01:06:07 -0800 | [diff] [blame] | 129 | regs = task_pt_regs(child); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 130 | ret = 0; /* Default return value. */ |
| 131 | |
| 132 | switch (addr) { |
| 133 | case 0 ... 31: |
| 134 | tmp = regs->regs[addr]; |
| 135 | break; |
| 136 | case FPR_BASE ... FPR_BASE + 31: |
| 137 | if (tsk_used_math(child)) { |
| 138 | fpureg_t *fregs = get_fpu_regs(child); |
| 139 | |
| 140 | /* |
| 141 | * The odd registers are actually the high |
| 142 | * order bits of the values stored in the even |
| 143 | * registers - unless we're using r2k_switch.S. |
| 144 | */ |
| 145 | if (addr & 1) |
| 146 | tmp = (unsigned long) (fregs[((addr & ~1) - 32)] >> 32); |
| 147 | else |
| 148 | tmp = (unsigned long) (fregs[(addr - 32)] & 0xffffffff); |
| 149 | } else { |
| 150 | tmp = -1; /* FP not yet used */ |
| 151 | } |
| 152 | break; |
| 153 | case PC: |
| 154 | tmp = regs->cp0_epc; |
| 155 | break; |
| 156 | case CAUSE: |
| 157 | tmp = regs->cp0_cause; |
| 158 | break; |
| 159 | case BADVADDR: |
| 160 | tmp = regs->cp0_badvaddr; |
| 161 | break; |
| 162 | case MMHI: |
| 163 | tmp = regs->hi; |
| 164 | break; |
| 165 | case MMLO: |
| 166 | tmp = regs->lo; |
| 167 | break; |
| 168 | case FPC_CSR: |
Atsushi Nemoto | eae8907 | 2006-05-16 01:26:03 +0900 | [diff] [blame] | 169 | tmp = child->thread.fpu.fcr31; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 170 | break; |
| 171 | case FPC_EIR: { /* implementation / version register */ |
| 172 | unsigned int flags; |
Ralf Baechle | 41c594a | 2006-04-05 09:45:45 +0100 | [diff] [blame] | 173 | #ifdef CONFIG_MIPS_MT_SMTC |
| 174 | unsigned int irqflags; |
| 175 | unsigned int mtflags; |
| 176 | #endif /* CONFIG_MIPS_MT_SMTC */ |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 177 | |
Atsushi Nemoto | 3055acb | 2006-01-29 22:34:32 +0900 | [diff] [blame] | 178 | if (!cpu_has_fpu) { |
| 179 | tmp = 0; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 180 | break; |
Atsushi Nemoto | 3055acb | 2006-01-29 22:34:32 +0900 | [diff] [blame] | 181 | } |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 182 | |
Ralf Baechle | 41c594a | 2006-04-05 09:45:45 +0100 | [diff] [blame] | 183 | #ifdef CONFIG_MIPS_MT_SMTC |
| 184 | /* Read-modify-write of Status must be atomic */ |
| 185 | local_irq_save(irqflags); |
| 186 | mtflags = dmt(); |
| 187 | #endif /* CONFIG_MIPS_MT_SMTC */ |
| 188 | |
Ralf Baechle | 101b353 | 2005-10-06 17:39:32 +0100 | [diff] [blame] | 189 | preempt_disable(); |
| 190 | if (cpu_has_mipsmt) { |
| 191 | unsigned int vpflags = dvpe(); |
| 192 | flags = read_c0_status(); |
| 193 | __enable_fpu(); |
| 194 | __asm__ __volatile__("cfc1\t%0,$0": "=r" (tmp)); |
| 195 | write_c0_status(flags); |
| 196 | evpe(vpflags); |
| 197 | } else { |
| 198 | flags = read_c0_status(); |
| 199 | __enable_fpu(); |
| 200 | __asm__ __volatile__("cfc1\t%0,$0": "=r" (tmp)); |
| 201 | write_c0_status(flags); |
| 202 | } |
Ralf Baechle | 41c594a | 2006-04-05 09:45:45 +0100 | [diff] [blame] | 203 | #ifdef CONFIG_MIPS_MT_SMTC |
| 204 | emt(mtflags); |
| 205 | local_irq_restore(irqflags); |
| 206 | #endif /* CONFIG_MIPS_MT_SMTC */ |
Ralf Baechle | 101b353 | 2005-10-06 17:39:32 +0100 | [diff] [blame] | 207 | preempt_enable(); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 208 | break; |
| 209 | } |
Atsushi Nemoto | 3055acb | 2006-01-29 22:34:32 +0900 | [diff] [blame] | 210 | case DSP_BASE ... DSP_BASE + 5: { |
| 211 | dspreg_t *dregs; |
| 212 | |
Ralf Baechle | e50c0a8 | 2005-05-31 11:49:19 +0000 | [diff] [blame] | 213 | if (!cpu_has_dsp) { |
| 214 | tmp = 0; |
| 215 | ret = -EIO; |
| 216 | goto out_tsk; |
| 217 | } |
Atsushi Nemoto | 3055acb | 2006-01-29 22:34:32 +0900 | [diff] [blame] | 218 | dregs = __get_dsp_regs(child); |
Ralf Baechle | 6c35585 | 2005-12-05 13:47:25 +0000 | [diff] [blame] | 219 | tmp = (unsigned long) (dregs[addr - DSP_BASE]); |
Ralf Baechle | e50c0a8 | 2005-05-31 11:49:19 +0000 | [diff] [blame] | 220 | break; |
Atsushi Nemoto | 3055acb | 2006-01-29 22:34:32 +0900 | [diff] [blame] | 221 | } |
Ralf Baechle | e50c0a8 | 2005-05-31 11:49:19 +0000 | [diff] [blame] | 222 | case DSP_CONTROL: |
| 223 | if (!cpu_has_dsp) { |
| 224 | tmp = 0; |
| 225 | ret = -EIO; |
| 226 | goto out_tsk; |
| 227 | } |
| 228 | tmp = child->thread.dsp.dspcontrol; |
| 229 | break; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 230 | default: |
| 231 | tmp = 0; |
| 232 | ret = -EIO; |
| 233 | goto out_tsk; |
| 234 | } |
Atsushi Nemoto | 3055acb | 2006-01-29 22:34:32 +0900 | [diff] [blame] | 235 | ret = put_user(tmp, (unsigned __user *) (unsigned long) data); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 236 | break; |
| 237 | } |
| 238 | |
| 239 | /* when I and D space are separate, this will have to be fixed. */ |
| 240 | case PTRACE_POKETEXT: /* write the word at location addr. */ |
| 241 | case PTRACE_POKEDATA: |
| 242 | ret = 0; |
| 243 | if (access_process_vm(child, addr, &data, sizeof(data), 1) |
| 244 | == sizeof(data)) |
| 245 | break; |
| 246 | ret = -EIO; |
| 247 | break; |
| 248 | |
Daniel Jacobowitz | ea3d710 | 2005-09-28 18:11:15 -0400 | [diff] [blame] | 249 | /* |
| 250 | * Write 4 bytes into the other process' storage |
| 251 | * data is the 4 bytes that the user wants written |
| 252 | * addr is a pointer in the user's storage that contains an |
| 253 | * 8 byte address in the other process where the 4 bytes |
| 254 | * that is to be written |
| 255 | * (this is run in a 32-bit process looking at a 64-bit process) |
| 256 | * when I and D space are separate, these will need to be fixed. |
| 257 | */ |
| 258 | case PTRACE_POKETEXT_3264: |
| 259 | case PTRACE_POKEDATA_3264: { |
| 260 | u32 __user * addrOthers; |
| 261 | |
| 262 | /* Get the addr in the other process that we want to write into */ |
| 263 | ret = -EIO; |
| 264 | if (get_user(addrOthers, (u32 __user * __user *) (unsigned long) addr) != 0) |
| 265 | break; |
| 266 | ret = 0; |
| 267 | if (access_process_vm(child, (u64)addrOthers, &data, |
| 268 | sizeof(data), 1) == sizeof(data)) |
| 269 | break; |
| 270 | ret = -EIO; |
| 271 | break; |
| 272 | } |
| 273 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 274 | case PTRACE_POKEUSR: { |
| 275 | struct pt_regs *regs; |
| 276 | ret = 0; |
Al Viro | 40bc9c6 | 2006-01-12 01:06:07 -0800 | [diff] [blame] | 277 | regs = task_pt_regs(child); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 278 | |
| 279 | switch (addr) { |
| 280 | case 0 ... 31: |
| 281 | regs->regs[addr] = data; |
| 282 | break; |
| 283 | case FPR_BASE ... FPR_BASE + 31: { |
| 284 | fpureg_t *fregs = get_fpu_regs(child); |
| 285 | |
| 286 | if (!tsk_used_math(child)) { |
| 287 | /* FP not yet used */ |
Atsushi Nemoto | eae8907 | 2006-05-16 01:26:03 +0900 | [diff] [blame] | 288 | memset(&child->thread.fpu, ~0, |
| 289 | sizeof(child->thread.fpu)); |
| 290 | child->thread.fpu.fcr31 = 0; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 291 | } |
| 292 | /* |
| 293 | * The odd registers are actually the high order bits |
| 294 | * of the values stored in the even registers - unless |
| 295 | * we're using r2k_switch.S. |
| 296 | */ |
| 297 | if (addr & 1) { |
| 298 | fregs[(addr & ~1) - FPR_BASE] &= 0xffffffff; |
| 299 | fregs[(addr & ~1) - FPR_BASE] |= ((unsigned long long) data) << 32; |
| 300 | } else { |
| 301 | fregs[addr - FPR_BASE] &= ~0xffffffffLL; |
| 302 | /* Must cast, lest sign extension fill upper |
| 303 | bits! */ |
| 304 | fregs[addr - FPR_BASE] |= (unsigned int)data; |
| 305 | } |
| 306 | break; |
| 307 | } |
| 308 | case PC: |
| 309 | regs->cp0_epc = data; |
| 310 | break; |
| 311 | case MMHI: |
| 312 | regs->hi = data; |
| 313 | break; |
| 314 | case MMLO: |
| 315 | regs->lo = data; |
| 316 | break; |
| 317 | case FPC_CSR: |
Atsushi Nemoto | eae8907 | 2006-05-16 01:26:03 +0900 | [diff] [blame] | 318 | child->thread.fpu.fcr31 = data; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 319 | break; |
Atsushi Nemoto | 3055acb | 2006-01-29 22:34:32 +0900 | [diff] [blame] | 320 | case DSP_BASE ... DSP_BASE + 5: { |
| 321 | dspreg_t *dregs; |
| 322 | |
Ralf Baechle | e50c0a8 | 2005-05-31 11:49:19 +0000 | [diff] [blame] | 323 | if (!cpu_has_dsp) { |
| 324 | ret = -EIO; |
| 325 | break; |
| 326 | } |
| 327 | |
Atsushi Nemoto | 3055acb | 2006-01-29 22:34:32 +0900 | [diff] [blame] | 328 | dregs = __get_dsp_regs(child); |
Ralf Baechle | e50c0a8 | 2005-05-31 11:49:19 +0000 | [diff] [blame] | 329 | dregs[addr - DSP_BASE] = data; |
| 330 | break; |
Atsushi Nemoto | 3055acb | 2006-01-29 22:34:32 +0900 | [diff] [blame] | 331 | } |
Ralf Baechle | e50c0a8 | 2005-05-31 11:49:19 +0000 | [diff] [blame] | 332 | case DSP_CONTROL: |
| 333 | if (!cpu_has_dsp) { |
| 334 | ret = -EIO; |
| 335 | break; |
| 336 | } |
| 337 | child->thread.dsp.dspcontrol = data; |
| 338 | break; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 339 | default: |
| 340 | /* The rest are not allowed. */ |
| 341 | ret = -EIO; |
| 342 | break; |
| 343 | } |
| 344 | break; |
| 345 | } |
| 346 | |
Daniel Jacobowitz | ea3d710 | 2005-09-28 18:11:15 -0400 | [diff] [blame] | 347 | case PTRACE_GETREGS: |
| 348 | ret = ptrace_getregs (child, (__u64 __user *) (__u64) data); |
| 349 | break; |
| 350 | |
| 351 | case PTRACE_SETREGS: |
| 352 | ret = ptrace_setregs (child, (__u64 __user *) (__u64) data); |
| 353 | break; |
| 354 | |
| 355 | case PTRACE_GETFPREGS: |
| 356 | ret = ptrace_getfpregs (child, (__u32 __user *) (__u64) data); |
| 357 | break; |
| 358 | |
| 359 | case PTRACE_SETFPREGS: |
| 360 | ret = ptrace_setfpregs (child, (__u32 __user *) (__u64) data); |
| 361 | break; |
| 362 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 363 | case PTRACE_SYSCALL: /* continue and stop at next (return from) syscall */ |
| 364 | case PTRACE_CONT: { /* restart after signal. */ |
| 365 | ret = -EIO; |
Jesper Juhl | 7ed20e1 | 2005-05-01 08:59:14 -0700 | [diff] [blame] | 366 | if (!valid_signal(data)) |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 367 | break; |
| 368 | if (request == PTRACE_SYSCALL) { |
| 369 | set_tsk_thread_flag(child, TIF_SYSCALL_TRACE); |
| 370 | } |
| 371 | else { |
| 372 | clear_tsk_thread_flag(child, TIF_SYSCALL_TRACE); |
| 373 | } |
| 374 | child->exit_code = data; |
| 375 | wake_up_process(child); |
| 376 | ret = 0; |
| 377 | break; |
| 378 | } |
| 379 | |
| 380 | /* |
| 381 | * make the child exit. Best I can do is send it a sigkill. |
| 382 | * perhaps it should be put in the status that it wants to |
| 383 | * exit. |
| 384 | */ |
| 385 | case PTRACE_KILL: |
| 386 | ret = 0; |
| 387 | if (child->exit_state == EXIT_ZOMBIE) /* already dead */ |
| 388 | break; |
| 389 | child->exit_code = SIGKILL; |
| 390 | wake_up_process(child); |
| 391 | break; |
| 392 | |
Ralf Baechle | 3c37026 | 2005-04-13 17:43:59 +0000 | [diff] [blame] | 393 | case PTRACE_GET_THREAD_AREA: |
Al Viro | dc8f602 | 2006-01-12 01:06:07 -0800 | [diff] [blame] | 394 | ret = put_user(task_thread_info(child)->tp_value, |
Ralf Baechle | 3c37026 | 2005-04-13 17:43:59 +0000 | [diff] [blame] | 395 | (unsigned int __user *) (unsigned long) data); |
| 396 | break; |
| 397 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 398 | case PTRACE_DETACH: /* detach a process that was attached. */ |
| 399 | ret = ptrace_detach(child, data); |
| 400 | break; |
| 401 | |
Ralf Baechle | 09276d9 | 2005-02-16 21:22:40 +0000 | [diff] [blame] | 402 | case PTRACE_GETEVENTMSG: |
| 403 | ret = put_user(child->ptrace_message, |
| 404 | (unsigned int __user *) (unsigned long) data); |
| 405 | break; |
| 406 | |
Daniel Jacobowitz | ea3d710 | 2005-09-28 18:11:15 -0400 | [diff] [blame] | 407 | case PTRACE_GET_THREAD_AREA_3264: |
Al Viro | dc8f602 | 2006-01-12 01:06:07 -0800 | [diff] [blame] | 408 | ret = put_user(task_thread_info(child)->tp_value, |
Daniel Jacobowitz | ea3d710 | 2005-09-28 18:11:15 -0400 | [diff] [blame] | 409 | (unsigned long __user *) (unsigned long) data); |
| 410 | break; |
| 411 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 412 | default: |
| 413 | ret = ptrace_request(child, request, addr, data); |
| 414 | break; |
| 415 | } |
| 416 | |
| 417 | out_tsk: |
| 418 | put_task_struct(child); |
| 419 | out: |
| 420 | unlock_kernel(); |
| 421 | return ret; |
| 422 | } |