lkml.org 
[lkml]   [2017]   [Jun]   [6]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Date
Subject[PATCH 10/26] ptrace: Simplify ptrace_detach & exit_ptrace
Call __ptrace_unlink not __ptrace_detach.  As it is guaranteed that
ptrace_detach will never be called on a process that has or may exit.

Rename __ptrace_detach __exit_ptrace as exit_ptrace is now it's only
caller and the corrected name is less confusing.

Signed-off-by: "Eric W. Biederman" <ebiederm@xmission.com>
---
kernel/ptrace.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/kernel/ptrace.c b/kernel/ptrace.c
index 266ddcc1d8bb..490333db9e21 100644
--- a/kernel/ptrace.c
+++ b/kernel/ptrace.c
@@ -495,7 +495,7 @@ static int ignoring_children(struct sighand_struct *sigh)
* reap it now, in that case we must also wake up sub-threads sleeping in
* do_wait().
*/
-static bool __ptrace_detach(struct task_struct *tracer, struct task_struct *p)
+static bool __exit_ptrace(struct task_struct *tracer, struct task_struct *p)
{
bool dead;

@@ -539,7 +539,7 @@ static int ptrace_detach(struct task_struct *child, unsigned int data)
* the comment in ptrace_resume().
*/
child->exit_code = data;
- __ptrace_detach(current, child);
+ __ptrace_unlink(child);
write_unlock_irq(&tasklist_lock);

proc_ptrace_connector(child, PTRACE_DETACH);
@@ -559,7 +559,7 @@ void exit_ptrace(struct task_struct *tracer, struct list_head *dead)
if (unlikely(p->ptrace & PT_EXITKILL))
send_sig_info(SIGKILL, SEND_SIG_FORCED, p);

- if (__ptrace_detach(tracer, p))
+ if (__exit_ptrace(tracer, p))
list_add(&p->ptrace_entry, dead);
}
}
--
2.10.1
\
 
 \ /
  Last update: 2017-06-12 00:53    [W:0.156 / U:0.540 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site