X-Git-Url: https://asedeno.scripts.mit.edu/gitweb/?a=blobdiff_plain;f=kernel%2Fpid_namespace.c;h=4918314893bc6620ae95660c78588d6d5ac9129c;hb=2554db916586b228ce93e6f74a12fd7fe430a004;hp=74a5a7255b4d9cb473cc7708d851c64402cca942;hpb=dc502142b65b9e31eb90ab4344b3acadb2698317;p=linux.git diff --git a/kernel/pid_namespace.c b/kernel/pid_namespace.c index 74a5a7255b4d..4918314893bc 100644 --- a/kernel/pid_namespace.c +++ b/kernel/pid_namespace.c @@ -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;