This is a note to let you know that I've just added the patch titled

    exit: pidns: alloc_pid() leaks pid_namespace if child_reaper is exiting

to the 3.14-stable tree which can be found at:
    
http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary

The filename of the patch is:
     exit-pidns-alloc_pid-leaks-pid_namespace-if-child_reaper-is-exiting.patch
and it can be found in the queue-3.14 subdirectory.

If you, or anyone else, feels it should not be added to the stable tree,
please let <[email protected]> know about it.


>From 24c037ebf5723d4d9ab0996433cee4f96c292a4d Mon Sep 17 00:00:00 2001
From: Oleg Nesterov <[email protected]>
Date: Wed, 10 Dec 2014 15:55:25 -0800
Subject: exit: pidns: alloc_pid() leaks pid_namespace if child_reaper is exiting

From: Oleg Nesterov <[email protected]>

commit 24c037ebf5723d4d9ab0996433cee4f96c292a4d upstream.

alloc_pid() does get_pid_ns() beforehand but forgets to put_pid_ns() if it
fails because disable_pid_allocation() was called by the exiting
child_reaper.

We could simply move get_pid_ns() down to successful return, but this fix
tries to be as trivial as possible.

Signed-off-by: Oleg Nesterov <[email protected]>
Reviewed-by: "Eric W. Biederman" <[email protected]>
Cc: Aaron Tomlin <[email protected]>
Cc: Pavel Emelyanov <[email protected]>
Cc: Serge Hallyn <[email protected]>
Cc: Sterling Alexander <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>

---
 kernel/pid.c |    2 ++
 1 file changed, 2 insertions(+)

--- a/kernel/pid.c
+++ b/kernel/pid.c
@@ -341,6 +341,8 @@ out:
 
 out_unlock:
        spin_unlock_irq(&pidmap_lock);
+       put_pid_ns(ns);
+
 out_free:
        while (++i <= ns->level)
                free_pidmap(pid->numbers + i);


Patches currently in stable-queue which might be from [email protected] are

queue-3.14/exit-pidns-alloc_pid-leaks-pid_namespace-if-child_reaper-is-exiting.patch
--
To unsubscribe from this list: send the line "unsubscribe stable" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to