pid_namespace.c (af4b8a83add95ef40716401395b44a1b579965f4) | pid_namespace.c (225778d68d98e7cfe2579f8d8b2d7b76f8541b8b) |
---|---|
1/* 2 * Pid namespaces 3 * 4 * Authors: 5 * (C) 2007 Pavel Emelyanov <xemul@openvz.org>, OpenVZ, SWsoft Inc. 6 * (C) 2007 Sukadev Bhattiprolu <sukadev@us.ibm.com>, IBM 7 * Many thanks to Oleg Nesterov for comments and help 8 * --- 132 unchanged lines hidden (view full) --- 141 142struct pid_namespace *copy_pid_ns(unsigned long flags, 143 struct user_namespace *user_ns, struct pid_namespace *old_ns) 144{ 145 if (!(flags & CLONE_NEWPID)) 146 return get_pid_ns(old_ns); 147 if (flags & (CLONE_THREAD|CLONE_PARENT)) 148 return ERR_PTR(-EINVAL); | 1/* 2 * Pid namespaces 3 * 4 * Authors: 5 * (C) 2007 Pavel Emelyanov <xemul@openvz.org>, OpenVZ, SWsoft Inc. 6 * (C) 2007 Sukadev Bhattiprolu <sukadev@us.ibm.com>, IBM 7 * Many thanks to Oleg Nesterov for comments and help 8 * --- 132 unchanged lines hidden (view full) --- 141 142struct pid_namespace *copy_pid_ns(unsigned long flags, 143 struct user_namespace *user_ns, struct pid_namespace *old_ns) 144{ 145 if (!(flags & CLONE_NEWPID)) 146 return get_pid_ns(old_ns); 147 if (flags & (CLONE_THREAD|CLONE_PARENT)) 148 return ERR_PTR(-EINVAL); |
149 if (task_active_pid_ns(current) != old_ns) 150 return ERR_PTR(-EINVAL); |
|
149 return create_pid_namespace(user_ns, old_ns); 150} 151 152static void free_pid_ns(struct kref *kref) 153{ 154 struct pid_namespace *ns; 155 156 ns = container_of(kref, struct pid_namespace, kref); --- 156 unchanged lines hidden --- | 151 return create_pid_namespace(user_ns, old_ns); 152} 153 154static void free_pid_ns(struct kref *kref) 155{ 156 struct pid_namespace *ns; 157 158 ns = container_of(kref, struct pid_namespace, kref); --- 156 unchanged lines hidden --- |