From: "Serge E. Hallyn" <serue@us.ibm.com>
To: Paul Menage <menage@google.com>
Cc: Li Zefan <lizf@cn.fujitsu.com>,
Andrew Morton <akpm@linux-foundation.org>,
LKML <linux-kernel@vger.kernel.org>,
Linux Containers <containers@lists.linux-foundation.org>
Subject: Re: [PATCH][BUGFIX] cgroups: fix pid namespace bug
Date: Thu, 2 Jul 2009 11:37:31 -0500 [thread overview]
Message-ID: <20090702163731.GA14267@us.ibm.com> (raw)
In-Reply-To: <6599ad830907020926t6305bec9t44a50cc165f6fc28@mail.gmail.com>
Quoting Paul Menage (menage@google.com):
> On Wed, Jul 1, 2009 at 6:24 PM, Li Zefan<lizf@cn.fujitsu.com> wrote:
> > + cp = kzalloc(sizeof(*cp), GFP_KERNEL);
> > + if (!cp) {
> > + up_write(&cgrp->pids_mutex);
> > + kfree(pidarray);
> > + return -ENOMEM;
> > + }
> > + cp->cgrp = cgrp;
> > + cp->pid_ns = pid_ns;
>
> You're storing an uncounted reference to the pid ns here - there's no
> guarantee that the pid_ns will outlive the open file.
Yeah I was thinking about that, but
1. the only way it won't outlive the open file is if the
task opens the file, hands the open fd over a
unix socket, then exits as the last task of its
pidns
2. We don't dereference the pid_ns, so there is no actual
safety issue. So it would become a problem only
if a new pidns gets created at that same address
*and* a task in the new pidns opens the same
tasks file.
Still, it wouldn't hurt to do get_pid_ns/put_pid_ns at the open
and release :)
-serge
next prev parent reply other threads:[~2009-07-02 16:37 UTC|newest]
Thread overview: 20+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-07-02 1:24 [PATCH][BUGFIX] cgroups: fix pid namespace bug Li Zefan
2009-07-02 1:36 ` Paul Menage
2009-07-02 1:45 ` Li Zefan
2009-07-02 1:57 ` KAMEZAWA Hiroyuki
2009-07-02 11:40 ` Balbir Singh
2009-07-02 2:17 ` Li Zefan
2009-07-02 2:20 ` Paul Menage
2009-07-02 2:28 ` Li Zefan
2009-07-02 13:26 ` Serge E. Hallyn
2009-07-02 15:43 ` Paul Menage
2009-07-02 16:15 ` Serge E. Hallyn
2009-07-02 16:27 ` Paul Menage
2009-07-02 23:20 ` Andrew Morton
2009-07-02 23:29 ` Paul Menage
2009-07-04 9:13 ` Eric W. Biederman
2009-07-02 13:58 ` Serge E. Hallyn
2009-07-02 16:26 ` Paul Menage
2009-07-02 16:37 ` Serge E. Hallyn [this message]
2009-07-02 16:46 ` Paul Menage
2009-07-02 19:14 ` Serge E. Hallyn
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=20090702163731.GA14267@us.ibm.com \
--to=serue@us.ibm.com \
--cc=akpm@linux-foundation.org \
--cc=containers@lists.linux-foundation.org \
--cc=linux-kernel@vger.kernel.org \
--cc=lizf@cn.fujitsu.com \
--cc=menage@google.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