mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Oleg Nesterov <oleg@redhat.com>
To: Amnon Shiloh <u3557@miso.sublimeip.com>
Cc: Denys Vlasenko <dvlasenk@redhat.com>,
	Michael Kerrisk <mtk.manpages@gmail.com>,
	Serge Hallyn <serge.hallyn@canonical.com>,
	Chris Evans <scarybeasts@gmail.com>,
	David Howells <dhowells@redhat.com>,
	"Eric W. Biederman" <ebiederm@xmission.com>,
	Andrew Morton <akpm@linux-foundation.org>,
	u3557@dialix.com.au, security@kernel.org,
	linux-kernel@vger.kernel.org
Subject: Re: PT_EXITKILL (Was: pdeath_signal)
Date: Thu, 8 Nov 2012 13:37:16 +0100	[thread overview]
Message-ID: <20121108123716.GA20917@redhat.com> (raw)
In-Reply-To: <20121108062935.BFF3A592024@miso.sublimeip.com>

Hi Amnon,

On 11/08, Amnon Shiloh wrote:
>
> Thanks for the patch, I tried it and it works nicely!

OK, thanks. I'll wait for other comments a bit and then send
the patch to Andrew.

> Also, I just noticed that this new option (PTRACE_O_EXITKILL) is not
> safe with ptrace(PTRACE_TRACEME)+execve, because the parent may die
> before even having a chance to set PTRACE_O_EXITKILL!

Not safe? I guess you meant that PTRACE_O_EXITKILL can't prevent
this race? Yes sure. Or the parent can die before it does
PTRACE_O_EXITKILL.

> However, that's easy to fix by using PTRACE_ATTACH instead.

Or the child can check getppid() == saved_parent_pid after PTRACE_TRACEME.

But if you switch to PTRACE_ATTACH, I'd suggest to use PTRACE_SEIZE.
Note that, in particular, this allows you to specify the options at
attach.

As for PF_NO_SIGSTOP, I'll write another email.

Oleg.


  reply	other threads:[~2012-11-08 12:36 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <20121106152050.GA18218@sergelap>
     [not found] ` <20121106201428.9D72959201A@miso.sublimeip.com>
2012-11-07 15:09   ` Oleg Nesterov
2012-11-08  6:29     ` Amnon Shiloh
2012-11-08 12:37       ` Oleg Nesterov [this message]
2012-11-08 13:03         ` Amnon Shiloh
2012-11-18 20:21         ` [PATCH 0/1] ptrace: introduce PTRACE_O_EXITKILL Oleg Nesterov
2012-11-18 20:21           ` [PATCH 1/1] " Oleg Nesterov
2012-11-08 12:48       ` PF_NO_SIGSTOP (Was: PT_EXITKILL) Oleg Nesterov
2012-11-08 14:05         ` Amnon Shiloh
2012-11-08 12:16     ` PT_EXITKILL (Was: pdeath_signal) Pedro Alves
2012-11-08 12:44       ` Oleg Nesterov
2012-11-08 13:00         ` Pedro Alves

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=20121108123716.GA20917@redhat.com \
    --to=oleg@redhat.com \
    --cc=akpm@linux-foundation.org \
    --cc=dhowells@redhat.com \
    --cc=dvlasenk@redhat.com \
    --cc=ebiederm@xmission.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mtk.manpages@gmail.com \
    --cc=scarybeasts@gmail.com \
    --cc=security@kernel.org \
    --cc=serge.hallyn@canonical.com \
    --cc=u3557@dialix.com.au \
    --cc=u3557@miso.sublimeip.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

Powered by JetHome