From: Oleg Nesterov <oleg@redhat.com>
To: Roland McGrath <roland@redhat.com>
Cc: Andrew Morton <akpm@linux-foundation.org>,
"Eric W. Biederman" <ebiederm@xmission.com>,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH 4/4] forget_original_parent: cleanup ptrace pathes
Date: Wed, 11 Feb 2009 00:40:14 +0100 [thread overview]
Message-ID: <20090210234014.GA15411@redhat.com> (raw)
In-Reply-To: <20090210232324.399ADFC3DB@magilla.sf.frob.com>
On 02/10, Roland McGrath wrote:
>
> > How about below? Modulo comments and some other cleanups. For example,
> > I think it is better to move the changing of ->real_parent into
> > reparent_thread().
>
> The exact split between reparent_thread and forget_original_parent (and
> their names) never made much sense to me.
>
> If ptrace_exit does its own lock/unlock, then it could move much earlier.
> I'd be inclined to do it right before exit_signals().
Yes. But since I am paranoid, can we move the callsite later? I mean,
I'd prefer to make a separate (trivial) patch which moves it.
> But it should at
> least short-circuit and not lock for list_empty(->ptraced), so we're not
> adding a whole lock_irq/unlock_irq to the common case of no ptrace use.
Agreed, and probably forget_original_parent() can check empty(->children)
too.
> > xxx = &p->real_parent->children;
> > if (reparent_thread(father, p))
> > xxx = &child_dead;
> > list_move_tail(&p->sibling, xxx);;
>
> I'd thought of this before. But I didn't mention it because I was afraid
> to wonder what might care about the use of ->sibling. It really looks like
> nothing does.
Yes, nobody should at least. Nobody can find this task on its own list.
> This is clearly the clean and nice way to go if there is no
> problem with it.
OK, will try to send the patches soon.
> This change and moving ptrace_exit around should probably be separate patches.
Yes, yes, sure.
If you don't mind, I'd prefer to make these changes on top of [PATCH 3/4],
reparent_thread-fix-a-zombie-leak-if-sbin-init-ignores-sigchld.patch
(and this one should be dropped).
Because that patch fixes the bug and changes the behaviour, while the
discussed changes are cleanups.
Oleg.
next prev parent reply other threads:[~2009-02-10 23:43 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-01-29 8:06 [PATCH 4/4] forget_original_parent: cleanup ptrace pathes Oleg Nesterov
2009-02-05 2:40 ` Roland McGrath
2009-02-05 15:33 ` Oleg Nesterov
2009-02-09 2:36 ` Roland McGrath
2009-02-10 22:47 ` Oleg Nesterov
2009-02-10 23:23 ` Roland McGrath
2009-02-10 23:40 ` Oleg Nesterov [this message]
2009-02-10 23:53 ` Roland McGrath
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=20090210234014.GA15411@redhat.com \
--to=oleg@redhat.com \
--cc=akpm@linux-foundation.org \
--cc=ebiederm@xmission.com \
--cc=linux-kernel@vger.kernel.org \
--cc=roland@redhat.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.