projects
/
firefly-linux-kernel-4.4.55.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
exit: pidns: alloc_pid() leaks pid_namespace if child_reaper is exiting
[firefly-linux-kernel-4.4.55.git]
/
kernel
/
pid.c
diff --git
a/kernel/pid.c
b/kernel/pid.c
index 0db3e791a06d48594606bc4789bc8fbe0fd5a4f0..3cdba517360050c24bbb00ad97c13e63c9492a43 100644
(file)
--- a/
kernel/pid.c
+++ b/
kernel/pid.c
@@
-264,6
+264,7
@@
void free_pid(struct pid *pid)
struct pid_namespace *ns = upid->ns;
hlist_del_rcu(&upid->pid_chain);
switch(--ns->nr_hashed) {
struct pid_namespace *ns = upid->ns;
hlist_del_rcu(&upid->pid_chain);
switch(--ns->nr_hashed) {
+ case 2:
case 1:
/* When all that is left in the pid namespace
* is the reaper wake up the reaper. The reaper
case 1:
/* When all that is left in the pid namespace
* is the reaper wake up the reaper. The reaper
@@
-334,6
+335,8
@@
out:
out_unlock:
spin_unlock_irq(&pidmap_lock);
out_unlock:
spin_unlock_irq(&pidmap_lock);
+ put_pid_ns(ns);
+
out_free:
while (++i <= ns->level)
free_pidmap(pid->numbers + i);
out_free:
while (++i <= ns->level)
free_pidmap(pid->numbers + i);