mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Tejun Heo <tj@kernel.org>
To: Oleg Nesterov <oleg@redhat.com>
Cc: Linus Torvalds <torvalds@linux-foundation.org>,
	vda.linux@googlemail.com, jan.kratochvil@redhat.com,
	pedro@codesourcery.com, linux-kernel@vger.kernel.org
Subject: Re: [PATCH 1/3] ptrace: ptrace_reparented() should check same_thread_group()
Date: Sat, 25 Jun 2011 15:43:50 +0200	[thread overview]
Message-ID: <20110625134350.GU30101@htj.dyndns.org> (raw)
In-Reply-To: <20110624153406.GB9346@redhat.com>

Hello,

On Fri, Jun 24, 2011 at 05:34:06PM +0200, Oleg Nesterov wrote:
> exit_notify: we should respect ->exit_signal if the exiting leader
> is traced by any thread from the parent thread group. It is the
> child of the whole group, and we are going to send the signal to
> the whole group.

This seems correct.

> wait_task_zombie: without __WNOTHREAD do_wait() should do the same
> for any thread, only sys_ptrace() is "bound" to the single thread.
> However do_wait(WEXITED) succeeds but does not release a traced
> natural child unless the caller is the tracer.
>
> Test-case:
...
> Note that the main thread simply does
> 
> 	pid = fork();
> 	kill(pid, SIGKILL);
> 
> and then without the patch wait4(WEXITED) succeeds twice and reports
> WTERMSIG(stat) == SIGKILL.

This latter one is interesting to say the least.  Yes, wait(2) is
process-wide operation and should behave identically when for all
threads in the same process.

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

This patch involves very subtle behavior change when the tracer is
multi-threaded && real parent of the tracee.  Slightly worrisome but
it is a bug fix and extremely fringe, so...

 Acked-by: Tejun Heo <tj@kernel.org>

Thanks.

-- 
tejun

  reply	other threads:[~2011-06-25 13:43 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 [this message]
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 ` [PATCH 3/3] ptrace: wait_consider_task: s/same_thread_group/ptrace_reparented/ Oleg Nesterov
2011-06-25 13:52   ` 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=20110625134350.GU30101@htj.dyndns.org \
    --to=tj@kernel.org \
    --cc=jan.kratochvil@redhat.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=oleg@redhat.com \
    --cc=pedro@codesourcery.com \
    --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

all inboxes | Powered by JetHome®