From: Oleg Nesterov <oleg@tv-sign.ru>
To: "Serge E. Hallyn" <serue@us.ibm.com>
Cc: Andrew Morton <akpm@linux-foundation.org>,
"Eric W. Biederman" <ebiederm@xmission.com>,
Pavel Emelyanov <xemul@openvz.org>,
Robert Rex <robert.rex@exasol.com>,
Roland McGrath <roland@redhat.com>,
Sukadev Bhattiprolu <sukadev@us.ibm.com>,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH 1/4] pid_ns: zap_pid_ns_processes: fix the ->child_reaper changing
Date: Wed, 27 Aug 2008 20:36:19 +0400 [thread overview]
Message-ID: <20080827163619.GB97@tv-sign.ru> (raw)
In-Reply-To: <20080826212526.GA12230@us.ibm.com>
On 08/26, Serge E. Hallyn wrote:
>
> Quoting Oleg Nesterov (oleg@tv-sign.ru):
> > zap_pid_ns_processes() sets pid_ns->child_reaper = NULL, this is wrong.
> > ...
> > Even if there are no childs, it is not good that forget_original_parent()
> > uses reaper == NULL.
> > ...
>
> Well while it looked correct to me all along, I couldn't get the
> testcase to cause an oops.
Perhaps you can start several instances or increase the delay, I
forgot that usleep() uses usecs, not msecs. In any case I agree,
the test-case is oversimplified, but since it worked for me I didn't
try to make it more "stubborn".
> Acked-by: Serge Hallyn <serue@us.ibm.com>
Thanks!
> > + /*
> > + * We can not clear ->child_reaper or leave it alone.
> > + * There may by stealth EXIT_DEAD tasks on ->children,
> > + * forget_original_parent() must move them somewhere.
>
> Actually this comment is a little bit misleading - the null
> deref will happen regardless of whether there are children,
> right?
Yes, the comment could be better ;)
But no, we won't oops without children. Please note that
forget_original_parent() uses reaper inside the
list_for_each_entry_safe(father->children) loop. ->children is
empty, reaper is not used at all.
But please also note the "not good" part of the changelog above.
Thanks to all for review!
Oleg.
next prev parent reply other threads:[~2008-08-27 16:32 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-08-24 15:49 Oleg Nesterov
2008-08-26 21:25 ` Serge E. Hallyn
2008-08-27 16:36 ` Oleg Nesterov [this message]
2008-08-27 1:43 ` sukadev
2008-08-27 11:35 ` Pavel Emelyanov
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=20080827163619.GB97@tv-sign.ru \
--to=oleg@tv-sign.ru \
--cc=akpm@linux-foundation.org \
--cc=ebiederm@xmission.com \
--cc=linux-kernel@vger.kernel.org \
--cc=robert.rex@exasol.com \
--cc=roland@redhat.com \
--cc=serue@us.ibm.com \
--cc=sukadev@us.ibm.com \
--cc=xemul@openvz.org \
/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®