From: Sukadev Bhattiprolu <sukadev@linux.vnet.ibm.com>
To: Andrew Morton <akpm@osdl.org>
Cc: dlezcano@fr.ibm.com, ebiederm@xmission.com, jack@ucw.cz,
andrea@cpushare.com, sukadev@us.ibm.com,
Containers <containers@lists.linux-foundation.org>,
linux-kernel@vger.kernel.org, Pavel Emelyanov <xemul@openvz.org>,
mingo@elte.hu, Alexey Dobriyan <adobriyan@gmail.com>
Subject: [PATCH] pidns: Fix a leak in /proc inodes and dentries
Date: Mon, 19 Oct 2009 21:13:37 -0700 [thread overview]
Message-ID: <20091020041337.GA31623@us.ibm.com> (raw)
Fix a leak in /proc dentries and inodes with pid namespaces.
This fix reverts the commit 7766755a2f249e7e0. The leak was reported by
Daniel Lezcano - see http://lkml.org/lkml/2009/10/2/159.
To summarize the thread, when container-init is terminated, it sets the
PF_EXITING flag and then zaps all the other processes in the container.
When those processes exit, they are expected to be reaped by the container-
init and as a part of reaping, the container-init should flush any /proc
dentries associated with the processes. But because the container-init is
itself exiting and the following PF_EXITING check, the dentires are not
flushed, resulting in leak in /proc inodes and dentries.
Signed-off-by: Sukadev Bhattiprolu <sukadev@us.ibm.com>
Reported-by: Daniel Lezcano <dlezcano@fr.ibm.com>
Cc: Eric W. Biederman <ebiederm@xmission.com>
Cc: Jan Kara <jack@ucw.cz>
Cc: Andrea Arcangeli <andrea@cpushare.com>
---
fs/proc/base.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
Index: linux-2.6/fs/proc/base.c
===================================================================
--- linux-2.6.orig/fs/proc/base.c 2009-10-19 20:28:51.000000000 -0700
+++ linux-2.6/fs/proc/base.c 2009-10-19 20:29:03.000000000 -0700
@@ -2580,8 +2580,7 @@ static void proc_flush_task_mnt(struct v
name.len = snprintf(buf, sizeof(buf), "%d", pid);
dentry = d_hash_and_lookup(mnt->mnt_root, &name);
if (dentry) {
- if (!(current->flags & PF_EXITING))
- shrink_dcache_parent(dentry);
+ shrink_dcache_parent(dentry);
d_drop(dentry);
dput(dentry);
}
next reply other threads:[~2009-10-20 4:12 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-10-20 4:13 Sukadev Bhattiprolu [this message]
2009-10-20 10:27 ` [PATCH] pidns: Fix a leak in /proc inodes and dentries Eric W. Biederman
[not found] ` <m1r5sywebv.fsf-+imSwln9KH6u2/kzUuoCbdi2O/JbrIOy@public.gmane.org>
2009-10-20 11:58 ` Cedric Le Goater
2009-10-20 11:58 ` Cedric Le Goater
[not found] ` <20091020041337.GA31623-r/Jw6+rmf7HQT0dZR+AlfA@public.gmane.org>
2009-10-20 10:27 ` Eric W. Biederman
2009-10-20 12:09 ` Alexey Dobriyan
2009-10-20 12:09 ` Alexey Dobriyan
-- strict thread matches above, loose matches on Subject: below --
2009-10-20 4:13 Sukadev Bhattiprolu
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=20091020041337.GA31623@us.ibm.com \
--to=sukadev@linux.vnet.ibm.com \
--cc=adobriyan@gmail.com \
--cc=akpm@osdl.org \
--cc=andrea@cpushare.com \
--cc=containers@lists.linux-foundation.org \
--cc=dlezcano@fr.ibm.com \
--cc=ebiederm@xmission.com \
--cc=jack@ucw.cz \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@elte.hu \
--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 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.