[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <201205091241.59060.vapier@gentoo.org>
Date: Wed, 9 May 2012 12:41:56 -0400
From: Mike Frysinger <vapier@...too.org>
To: Oleg Nesterov <oleg@...hat.com>
Cc: Pedro Alves <palves@...hat.com>,
"Michael Kerrisk (man-pages)" <mtk.manpages@...il.com>,
pacman@...h.dhis.org, "linux-man" <linux-man@...r.kernel.org>,
lkml <linux-kernel@...r.kernel.org>,
Denys Vlasenko <dvlasenk@...hat.com>,
Tejun Heo <tj@...nel.org>,
Jan Kratochvil <jan.kratochvil@...hat.com>
Subject: Re: ptrace.2: PTRACE_KILL needs a stopped process too
On Wednesday 09 May 2012 16:12:19 Oleg Nesterov wrote:
> On 05/09, Pedro Alves wrote:
> > On 05/09/2012 04:09 PM, Mike Frysinger wrote:
> > > probably not that big of a deal, but the reason i like using
> > > ptrace(PTRACE_KILL) over a raw kill() is that you are less likely to
> > > kill the wrong process by accident. maybe not that big of a deal in
> > > practice though.
> >
> > And you can do tgkill instead. It was specifically invented to handle
> > the reuse case.
>
> tgkill() can kill the wrong process/thread too, although it lessens the
> risk.
>
> But I don't really understand the problem. The traced thread can't go away
> until the tracer does wait/detach, and thus its pid can't be reused?
or the process has received a SIGKILL for some reason
> May be, "by accident" above means something else, not pid reuse...
i like to assume that my code isn't going to be bug free, so the more
mechanisms i have in place to protect innocent bystanders the better :)
-mike
Download attachment "signature.asc " of type "application/pgp-signature" (837 bytes)
Powered by blists - more mailing lists