* [PATCH] pidns: Fix a leak in /proc inodes and dentries
@ 2009-10-20 4:13 Sukadev Bhattiprolu
[not found] ` <20091020041337.GA31623-r/Jw6+rmf7HQT0dZR+AlfA@public.gmane.org>
` (2 more replies)
0 siblings, 3 replies; 8+ messages in thread
From: Sukadev Bhattiprolu @ 2009-10-20 4:13 UTC (permalink / raw)
To: Andrew Morton
Cc: dlezcano, ebiederm, jack, andrea, sukadev, Containers,
linux-kernel, Pavel Emelyanov, mingo, Alexey Dobriyan
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);
}
^ permalink raw reply [flat|nested] 8+ messages in thread[parent not found: <20091020041337.GA31623-r/Jw6+rmf7HQT0dZR+AlfA@public.gmane.org>]
* Re: [PATCH] pidns: Fix a leak in /proc inodes and dentries
[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
1 sibling, 0 replies; 8+ messages in thread
From: Eric W. Biederman @ 2009-10-20 10:27 UTC (permalink / raw)
To: Sukadev Bhattiprolu
Cc: jack-+ZI9xUNit7I, Containers, linux-kernel-u79uwXL29TY76Z2rM5mHXA,
andrea-Vyt77T80VFVWk0Htik3J/w, Alexey Dobriyan,
dlezcano-NmTC/0ZBporQT0dZR+AlfA, mingo-X9Un+BFzKDI,
Pavel Emelyanov
Sukadev Bhattiprolu <sukadev-23VcF4HTsmIX0ybBhKVfKdBPR1lH4CV8@public.gmane.org> writes:
> 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.
Acked-by: "Eric W. Biederman" <ebiederm-aS9lmoZGLiVWk0Htik3J/w@public.gmane.org>
> Signed-off-by: Sukadev Bhattiprolu <sukadev-r/Jw6+rmf7HQT0dZR+AlfA@public.gmane.org>
> Reported-by: Daniel Lezcano <dlezcano-NmTC/0ZBporQT0dZR+AlfA@public.gmane.org>
> Cc: Eric W. Biederman <ebiederm-aS9lmoZGLiVWk0Htik3J/w@public.gmane.org>
> Cc: Jan Kara <jack-+ZI9xUNit7I@public.gmane.org>
> Cc: Andrea Arcangeli <andrea-Vyt77T80VFVWk0Htik3J/w@public.gmane.org>
>
> ---
> 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);
> }
^ permalink raw reply [flat|nested] 8+ messages in thread* Re: [PATCH] pidns: Fix a leak in /proc inodes and dentries
[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
1 sibling, 0 replies; 8+ messages in thread
From: Alexey Dobriyan @ 2009-10-20 12:09 UTC (permalink / raw)
To: Sukadev Bhattiprolu
Cc: jack-+ZI9xUNit7I, Containers, linux-kernel-u79uwXL29TY76Z2rM5mHXA,
andrea-Vyt77T80VFVWk0Htik3J/w, ebiederm-aS9lmoZGLiVWk0Htik3J/w,
dlezcano-NmTC/0ZBporQT0dZR+AlfA, mingo-X9Un+BFzKDI,
Pavel Emelyanov
On Mon, Oct 19, 2009 at 09:13:37PM -0700, Sukadev Bhattiprolu wrote:
> --- linux-2.6.orig/fs/proc/base.c
> +++ linux-2.6/fs/proc/base.c
> @@ -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);
What to do with original deadlock?
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH] pidns: Fix a leak in /proc inodes and dentries
2009-10-20 4:13 [PATCH] pidns: Fix a leak in /proc inodes and dentries Sukadev Bhattiprolu
[not found] ` <20091020041337.GA31623-r/Jw6+rmf7HQT0dZR+AlfA@public.gmane.org>
@ 2009-10-20 10:27 ` Eric W. Biederman
[not found] ` <m1r5sywebv.fsf-+imSwln9KH6u2/kzUuoCbdi2O/JbrIOy@public.gmane.org>
2009-10-20 12:09 ` Alexey Dobriyan
2 siblings, 1 reply; 8+ messages in thread
From: Eric W. Biederman @ 2009-10-20 10:27 UTC (permalink / raw)
To: Sukadev Bhattiprolu
Cc: Andrew Morton, dlezcano, jack, andrea, sukadev, Containers,
linux-kernel, Pavel Emelyanov, mingo, Alexey Dobriyan
Sukadev Bhattiprolu <sukadev@linux.vnet.ibm.com> writes:
> 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.
Acked-by: "Eric W. Biederman" <ebiederm@xmission.com>
> 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);
> }
^ permalink raw reply [flat|nested] 8+ messages in thread* Re: [PATCH] pidns: Fix a leak in /proc inodes and dentries
2009-10-20 4:13 [PATCH] pidns: Fix a leak in /proc inodes and dentries Sukadev Bhattiprolu
[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
2 siblings, 0 replies; 8+ messages in thread
From: Alexey Dobriyan @ 2009-10-20 12:09 UTC (permalink / raw)
To: Sukadev Bhattiprolu
Cc: Andrew Morton, dlezcano, ebiederm, jack, andrea, sukadev,
Containers, linux-kernel, Pavel Emelyanov, mingo
On Mon, Oct 19, 2009 at 09:13:37PM -0700, Sukadev Bhattiprolu wrote:
> --- linux-2.6.orig/fs/proc/base.c
> +++ linux-2.6/fs/proc/base.c
> @@ -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);
What to do with original deadlock?
^ permalink raw reply [flat|nested] 8+ messages in thread
* [PATCH] pidns: Fix a leak in /proc inodes and dentries
@ 2009-10-20 4:13 Sukadev Bhattiprolu
0 siblings, 0 replies; 8+ messages in thread
From: Sukadev Bhattiprolu @ 2009-10-20 4:13 UTC (permalink / raw)
To: Andrew Morton
Cc: jack-+ZI9xUNit7I, Containers, linux-kernel-u79uwXL29TY76Z2rM5mHXA,
andrea-Vyt77T80VFVWk0Htik3J/w, Alexey Dobriyan,
ebiederm-aS9lmoZGLiVWk0Htik3J/w, dlezcano-NmTC/0ZBporQT0dZR+AlfA,
mingo-X9Un+BFzKDI, Pavel Emelyanov
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-r/Jw6+rmf7HQT0dZR+AlfA@public.gmane.org>
Reported-by: Daniel Lezcano <dlezcano-NmTC/0ZBporQT0dZR+AlfA@public.gmane.org>
Cc: Eric W. Biederman <ebiederm-aS9lmoZGLiVWk0Htik3J/w@public.gmane.org>
Cc: Jan Kara <jack-+ZI9xUNit7I@public.gmane.org>
Cc: Andrea Arcangeli <andrea-Vyt77T80VFVWk0Htik3J/w@public.gmane.org>
---
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);
}
^ permalink raw reply [flat|nested] 8+ messages in thread
end of thread, other threads:[~2009-10-20 12:09 UTC | newest]
Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-10-20 4:13 [PATCH] pidns: Fix a leak in /proc inodes and dentries Sukadev Bhattiprolu
[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 10:27 ` 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
2009-10-20 12:09 ` Alexey Dobriyan
-- strict thread matches above, loose matches on Subject: below --
2009-10-20 4:13 Sukadev Bhattiprolu
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.