Commit 1bcf548293aef19b0797348332cf1dfbf2116cef
Committed by
Linus Torvalds
1 parent
e6716b87d5
Exists in
master
and in
40 other branches
Consolidate PTRACE_DETACH
Identical handlers of PTRACE_DETACH go into ptrace_request(). Not touching compat code. Not touching archs that don't call ptrace_request. Signed-off-by: Alexey Dobriyan <adobriyan@sw.ru> Acked-by: Christoph Hellwig <hch@infradead.org> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Showing 19 changed files with 3 additions and 83 deletions Side-by-side Diff
- arch/alpha/kernel/ptrace.c
- arch/arm/kernel/ptrace.c
- arch/avr32/kernel/ptrace.c
- arch/blackfin/kernel/ptrace.c
- arch/cris/arch-v10/kernel/ptrace.c
- arch/cris/arch-v32/kernel/ptrace.c
- arch/m32r/kernel/ptrace.c
- arch/m68k/kernel/ptrace.c
- arch/mips/kernel/ptrace.c
- arch/parisc/kernel/ptrace.c
- arch/powerpc/kernel/ptrace.c
- arch/s390/kernel/ptrace.c
- arch/sh/kernel/ptrace.c
- arch/sh64/kernel/ptrace.c
- arch/um/kernel/ptrace.c
- arch/x86/kernel/ptrace_32.c
- arch/x86/kernel/ptrace_64.c
- arch/xtensa/kernel/ptrace.c
- kernel/ptrace.c
arch/alpha/kernel/ptrace.c
arch/arm/kernel/ptrace.c
arch/avr32/kernel/ptrace.c
... | ... | @@ -227,11 +227,6 @@ |
227 | 227 | ret = 0; |
228 | 228 | break; |
229 | 229 | |
230 | - /* Detach a process that was attached */ | |
231 | - case PTRACE_DETACH: | |
232 | - ret = ptrace_detach(child, data); | |
233 | - break; | |
234 | - | |
235 | 230 | case PTRACE_GETREGS: |
236 | 231 | ret = ptrace_getregs(child, (void __user *)data); |
237 | 232 | break; |
arch/blackfin/kernel/ptrace.c
arch/cris/arch-v10/kernel/ptrace.c
arch/cris/arch-v32/kernel/ptrace.c
arch/m32r/kernel/ptrace.c
... | ... | @@ -704,14 +704,6 @@ |
704 | 704 | break; |
705 | 705 | } |
706 | 706 | |
707 | - /* | |
708 | - * detach a process that was attached. | |
709 | - */ | |
710 | - case PTRACE_DETACH: | |
711 | - ret = 0; | |
712 | - ret = ptrace_detach(child, data); | |
713 | - break; | |
714 | - | |
715 | 707 | case PTRACE_GETREGS: |
716 | 708 | ret = ptrace_getregs(child, (void __user *)data); |
717 | 709 | break; |
arch/m68k/kernel/ptrace.c
... | ... | @@ -226,10 +226,6 @@ |
226 | 226 | wake_up_process(child); |
227 | 227 | break; |
228 | 228 | |
229 | - case PTRACE_DETACH: /* detach a process that was attached. */ | |
230 | - ret = ptrace_detach(child, data); | |
231 | - break; | |
232 | - | |
233 | 229 | case PTRACE_GETREGS: /* Get all gp regs from the child. */ |
234 | 230 | for (i = 0; i < 19; i++) { |
235 | 231 | tmp = get_reg(child, i); |
arch/mips/kernel/ptrace.c
... | ... | @@ -435,10 +435,6 @@ |
435 | 435 | wake_up_process(child); |
436 | 436 | break; |
437 | 437 | |
438 | - case PTRACE_DETACH: /* detach a process that was attached. */ | |
439 | - ret = ptrace_detach(child, data); | |
440 | - break; | |
441 | - | |
442 | 438 | case PTRACE_GET_THREAD_AREA: |
443 | 439 | ret = put_user(task_thread_info(child)->tp_value, |
444 | 440 | (unsigned long __user *) data); |
arch/parisc/kernel/ptrace.c
... | ... | @@ -329,10 +329,6 @@ |
329 | 329 | /* give it a chance to run. */ |
330 | 330 | goto out_wake; |
331 | 331 | |
332 | - case PTRACE_DETACH: | |
333 | - ret = ptrace_detach(child, data); | |
334 | - goto out_tsk; | |
335 | - | |
336 | 332 | case PTRACE_GETEVENTMSG: |
337 | 333 | ret = put_user(child->ptrace_message, (unsigned int __user *) data); |
338 | 334 | goto out_tsk; |
arch/powerpc/kernel/ptrace.c
arch/s390/kernel/ptrace.c
... | ... | @@ -683,11 +683,6 @@ |
683 | 683 | wake_up_process(child); |
684 | 684 | return 0; |
685 | 685 | |
686 | - case PTRACE_DETACH: | |
687 | - /* detach a process that was attached. */ | |
688 | - return ptrace_detach(child, data); | |
689 | - | |
690 | - | |
691 | 686 | /* Do requests that differ for 31/64 bit */ |
692 | 687 | default: |
693 | 688 | #ifdef CONFIG_COMPAT |
arch/sh/kernel/ptrace.c
arch/sh64/kernel/ptrace.c
arch/um/kernel/ptrace.c
... | ... | @@ -119,11 +119,6 @@ |
119 | 119 | break; |
120 | 120 | } |
121 | 121 | |
122 | - case PTRACE_DETACH: | |
123 | - /* detach a process that was attached. */ | |
124 | - ret = ptrace_detach(child, data); | |
125 | - break; | |
126 | - | |
127 | 122 | #ifdef PTRACE_GETREGS |
128 | 123 | case PTRACE_GETREGS: { /* Get all gp regs from the child. */ |
129 | 124 | if (!access_ok(VERIFY_WRITE, p, MAX_REG_OFFSET)) { |
arch/x86/kernel/ptrace_32.c
... | ... | @@ -524,11 +524,6 @@ |
524 | 524 | ret = 0; |
525 | 525 | break; |
526 | 526 | |
527 | - case PTRACE_DETACH: | |
528 | - /* detach a process that was attached. */ | |
529 | - ret = ptrace_detach(child, data); | |
530 | - break; | |
531 | - | |
532 | 527 | case PTRACE_GETREGS: { /* Get all gp regs from the child. */ |
533 | 528 | if (!access_ok(VERIFY_WRITE, datap, FRAME_SIZE*sizeof(long))) { |
534 | 529 | ret = -EIO; |
arch/x86/kernel/ptrace_64.c
... | ... | @@ -500,11 +500,6 @@ |
500 | 500 | ret = 0; |
501 | 501 | break; |
502 | 502 | |
503 | - case PTRACE_DETACH: | |
504 | - /* detach a process that was attached. */ | |
505 | - ret = ptrace_detach(child, data); | |
506 | - break; | |
507 | - | |
508 | 503 | case PTRACE_GETREGS: { /* Get all gp regs from the child. */ |
509 | 504 | if (!access_ok(VERIFY_WRITE, (unsigned __user *)data, |
510 | 505 | sizeof(struct user_regs_struct))) { |
arch/xtensa/kernel/ptrace.c
... | ... | @@ -304,10 +304,6 @@ |
304 | 304 | ret = put_user(sizeof(elf_fpregset_t), (unsigned long *) data); |
305 | 305 | break; |
306 | 306 | |
307 | - case PTRACE_DETACH: /* detach a process that was attached. */ | |
308 | - ret = ptrace_detach(child, data); | |
309 | - break; | |
310 | - | |
311 | 307 | default: |
312 | 308 | ret = ptrace_request(child, request, addr, data); |
313 | 309 | goto out; |
kernel/ptrace.c
... | ... | @@ -386,6 +386,9 @@ |
386 | 386 | case PTRACE_SETSIGINFO: |
387 | 387 | ret = ptrace_setsiginfo(child, (siginfo_t __user *) data); |
388 | 388 | break; |
389 | + case PTRACE_DETACH: /* detach a process that was attached. */ | |
390 | + ret = ptrace_detach(child, data); | |
391 | + break; | |
389 | 392 | default: |
390 | 393 | break; |
391 | 394 | } |