public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Oleg Nesterov <oleg@redhat.com>
To: Tejun Heo <tj@kernel.org>,
	Linus Torvalds <torvalds@linux-foundation.org>
Cc: vda.linux@googlemail.com, jan.kratochvil@redhat.com,
	pedro@codesourcery.com, linux-kernel@vger.kernel.org
Subject: [PATCH 3/3] ptrace: wait_consider_task: s/same_thread_group/ptrace_reparented/
Date: Fri, 24 Jun 2011 17:34:39 +0200	[thread overview]
Message-ID: <20110624153439.GD9346@redhat.com> (raw)
In-Reply-To: <20110624153330.GA9346@redhat.com>

wait_consider_task() checks same_thread_group(parent, real_parent),
this is the open-coded ptrace_reparented().

__ptrace_detach() remains the only function which has to check this by
hand, although we could reorganize the code to delay __ptrace_unlink.

Signed-off-by: Oleg Nesterov <oleg@redhat.com>
---

 kernel/exit.c |    3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

--- ptrace/kernel/exit.c~11_p_r_more_users	2011-06-23 19:11:34.000000000 +0200
+++ ptrace/kernel/exit.c	2011-06-24 17:10:07.000000000 +0200
@@ -1598,8 +1598,7 @@ static int wait_consider_task(struct wai
 		 * own children, it should create a separate process which
 		 * takes the role of real parent.
 		 */
-		if (likely(!ptrace) && p->ptrace &&
-		    same_thread_group(p->parent, p->real_parent))
+		if (likely(!ptrace) && p->ptrace && !ptrace_reparented(p))
 			return 0;
 
 		/*


  parent reply	other threads:[~2011-06-24 15:37 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-06-24 15:33 [PATCH 0/3] ptrace_reparented fixes/cleanups Oleg Nesterov
2011-06-24 15:34 ` [PATCH 1/3] ptrace: ptrace_reparented() should check same_thread_group() Oleg Nesterov
2011-06-25 13:43   ` Tejun Heo
2011-06-26 21:08     ` Oleg Nesterov
2011-06-24 15:34 ` [PATCH 2/3] ptrace: kill real_parent_is_ptracer() in in favor of ptrace_reparented() Oleg Nesterov
2011-06-25 13:49   ` Tejun Heo
2011-06-24 15:34 ` Oleg Nesterov [this message]
2011-06-25 13:52   ` [PATCH 3/3] ptrace: wait_consider_task: s/same_thread_group/ptrace_reparented/ Tejun Heo

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20110624153439.GD9346@redhat.com \
    --to=oleg@redhat.com \
    --cc=jan.kratochvil@redhat.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=pedro@codesourcery.com \
    --cc=tj@kernel.org \
    --cc=torvalds@linux-foundation.org \
    --cc=vda.linux@googlemail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox