Skip to content

Commit 1bcf548

Browse files
Alexey DobriyanLinus Torvalds
authored andcommitted
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>
1 parent e6716b8 commit 1bcf548

19 files changed

Lines changed: 3 additions & 83 deletions

File tree

‎arch/alpha/kernel/ptrace.c‎

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -368,10 +368,6 @@ do_sys_ptrace(long request, long pid, long addr, long data,
368368
ret = 0;
369369
goto out;
370370

371-
case PTRACE_DETACH: /* detach a process that was attached. */
372-
ret = ptrace_detach(child, data);
373-
goto out;
374-
375371
default:
376372
ret = ptrace_request(child, request, addr, data);
377373
goto out;

‎arch/arm/kernel/ptrace.c‎

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -731,10 +731,6 @@ long arch_ptrace(struct task_struct *child, long request, long addr, long data)
731731
ret = 0;
732732
break;
733733

734-
case PTRACE_DETACH:
735-
ret = ptrace_detach(child, data);
736-
break;
737-
738734
case PTRACE_GETREGS:
739735
ret = ptrace_getregs(child, (void __user *)data);
740736
break;

‎arch/avr32/kernel/ptrace.c‎

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -227,11 +227,6 @@ long arch_ptrace(struct task_struct *child, long request, long addr, long data)
227227
ret = 0;
228228
break;
229229

230-
/* Detach a process that was attached */
231-
case PTRACE_DETACH:
232-
ret = ptrace_detach(child, data);
233-
break;
234-
235230
case PTRACE_GETREGS:
236231
ret = ptrace_getregs(child, (void __user *)data);
237232
break;

‎arch/blackfin/kernel/ptrace.c‎

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -385,12 +385,6 @@ long arch_ptrace(struct task_struct *child, long request, long addr, long data)
385385
break;
386386
}
387387

388-
case PTRACE_DETACH:
389-
{ /* detach a process that was attached. */
390-
ret = ptrace_detach(child, data);
391-
break;
392-
}
393-
394388
case PTRACE_GETREGS:
395389
{
396390

‎arch/cris/arch-v10/kernel/ptrace.c‎

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -177,10 +177,6 @@ long arch_ptrace(struct task_struct *child, long request, long addr, long data)
177177
ret = 0;
178178
break;
179179

180-
case PTRACE_DETACH:
181-
ret = ptrace_detach(child, data);
182-
break;
183-
184180
/* Get all GP registers from the child. */
185181
case PTRACE_GETREGS: {
186182
int i;

‎arch/cris/arch-v32/kernel/ptrace.c‎

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -245,10 +245,6 @@ long arch_ptrace(struct task_struct *child, long request, long addr, long data)
245245
break;
246246

247247
}
248-
case PTRACE_DETACH:
249-
ret = ptrace_detach(child, data);
250-
break;
251-
252248
/* Get all GP registers from the child. */
253249
case PTRACE_GETREGS: {
254250
int i;

‎arch/m32r/kernel/ptrace.c‎

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -704,14 +704,6 @@ do_ptrace(long request, struct task_struct *child, long addr, long data)
704704
break;
705705
}
706706

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-
715707
case PTRACE_GETREGS:
716708
ret = ptrace_getregs(child, (void __user *)data);
717709
break;

‎arch/m68k/kernel/ptrace.c‎

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -226,10 +226,6 @@ long arch_ptrace(struct task_struct *child, long request, long addr, long data)
226226
wake_up_process(child);
227227
break;
228228

229-
case PTRACE_DETACH: /* detach a process that was attached. */
230-
ret = ptrace_detach(child, data);
231-
break;
232-
233229
case PTRACE_GETREGS: /* Get all gp regs from the child. */
234230
for (i = 0; i < 19; i++) {
235231
tmp = get_reg(child, i);

‎arch/mips/kernel/ptrace.c‎

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -435,10 +435,6 @@ long arch_ptrace(struct task_struct *child, long request, long addr, long data)
435435
wake_up_process(child);
436436
break;
437437

438-
case PTRACE_DETACH: /* detach a process that was attached. */
439-
ret = ptrace_detach(child, data);
440-
break;
441-
442438
case PTRACE_GET_THREAD_AREA:
443439
ret = put_user(task_thread_info(child)->tp_value,
444440
(unsigned long __user *) data);

‎arch/parisc/kernel/ptrace.c‎

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -329,10 +329,6 @@ long arch_ptrace(struct task_struct *child, long request, long addr, long data)
329329
/* give it a chance to run. */
330330
goto out_wake;
331331

332-
case PTRACE_DETACH:
333-
ret = ptrace_detach(child, data);
334-
goto out_tsk;
335-
336332
case PTRACE_GETEVENTMSG:
337333
ret = put_user(child->ptrace_message, (unsigned int __user *) data);
338334
goto out_tsk;

0 commit comments

Comments
 (0)