summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--kernel/pid_namespace.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/kernel/pid_namespace.c b/kernel/pid_namespace.c
index 3cc29b830e9..0dbbc66b6ec 100644
--- a/kernel/pid_namespace.c
+++ b/kernel/pid_namespace.c
@@ -146,6 +146,8 @@ struct pid_namespace *copy_pid_ns(unsigned long flags,
return get_pid_ns(old_ns);
if (flags & (CLONE_THREAD|CLONE_PARENT))
return ERR_PTR(-EINVAL);
+ if (task_active_pid_ns(current) != old_ns)
+ return ERR_PTR(-EINVAL);
return create_pid_namespace(user_ns, old_ns);
}