Merge tag 'trace-v4.14-rc1-2' of git://git.kernel.org/pub/scm/linux/kernel/git/rosted...
[linux-2.6-microblaze.git] / kernel / pid_namespace.c
index 74a5a72..4918314 100644 (file)
@@ -101,6 +101,10 @@ static struct pid_namespace *create_pid_namespace(struct user_namespace *user_ns
        int i;
        int err;
 
+       err = -EINVAL;
+       if (!in_userns(parent_pid_ns->user_ns, user_ns))
+               goto out;
+
        err = -ENOSPC;
        if (level > MAX_PID_NS_LEVEL)
                goto out;