The patch titled Subject: namespaces, pid_ns: fix leakage on fork() failure has been added to the -mm tree. Its filename is namespaces-fix-leak-on-fork-failure.patch Before you just go and hit "reply", please: a) Consider who else should be cc'ed b) Prefer to cc a suitable mailing list as well c) Ideally: find the original patch on the mailing list and do a reply-to-all to that, adding suitable additional cc's *** Remember to use Documentation/SubmitChecklist when testing your code *** The -mm tree is included into linux-next and is updated there every 3-4 working days ------------------------------------------------------ From: Mike Galbraith <efault@xxxxxx> Subject: namespaces, pid_ns: fix leakage on fork() failure Fork() failure post namespace creation for a child cloned with CLONE_NEWPID leaks pid_namespace/mnt_cache due to proc being mounted during creation, but not unmounted during cleanup. Call pid_ns_release_proc() during cleanup. Signed-off-by: Mike Galbraith <efault@xxxxxx> Acked-by: Oleg Nesterov <oleg@xxxxxxxxxx> Reviewed-by: "Eric W. Biederman" <ebiederm@xxxxxxxxxxxx> Cc: Pavel Emelyanov <xemul@xxxxxxxxxxxxx> Cc: Cyrill Gorcunov <gorcunov@xxxxxxxxxx> Cc: Louis Rilling <louis.rilling@xxxxxxxxxxx> Signed-off-by: Andrew Morton <akpm@xxxxxxxxxxxxxxxxxxxx> --- kernel/fork.c | 3 +++ 1 file changed, 3 insertions(+) diff -puN kernel/fork.c~namespaces-fix-leak-on-fork-failure kernel/fork.c --- a/kernel/fork.c~namespaces-fix-leak-on-fork-failure +++ a/kernel/fork.c @@ -48,6 +48,7 @@ #include <linux/audit.h> #include <linux/memcontrol.h> #include <linux/ftrace.h> +#include <linux/proc_fs.h> #include <linux/profile.h> #include <linux/rmap.h> #include <linux/ksm.h> @@ -1475,6 +1476,8 @@ bad_fork_cleanup_io: if (p->io_context) exit_io_context(p); bad_fork_cleanup_namespaces: + if (unlikely(clone_flags & CLONE_NEWPID)) + pid_ns_release_proc(p->nsproxy->pid_ns); exit_task_namespaces(p); bad_fork_cleanup_mm: if (p->mm) _ Subject: Subject: namespaces, pid_ns: fix leakage on fork() failure Patches currently in -mm which might be from efault@xxxxxx are linux-next.patch namespaces-fix-leak-on-fork-failure.patch ipc-semc-alternatives-to-preempt_disable.patch -- To unsubscribe from this list: send the line "unsubscribe mm-commits" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html