From mboxrd@z Thu Jan 1 00:00:00 1970 From: Sukadev Bhattiprolu Subject: Re: [RFC][v8][PATCH 0/10] Implement clone3() system call Date: Fri, 23 Oct 2009 20:38:39 -0700 Message-ID: <20091024033839.GA16430@us.ibm.com> References: <20091021062021.GA2667@us.ibm.com> <20091023004253.GA7915@us.ibm.com> <20091023053001.GA24972@us.ibm.com> <20091023192124.GA11088@us.ibm.com> <20091023204812.GA26524@us.ibm.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Return-path: Content-Disposition: inline In-Reply-To: Sender: linux-api-owner-u79uwXL29TY76Z2rM5mHXA@public.gmane.org To: "Eric W. Biederman" Cc: Matt Helsley , Oren Laadan , Daniel Lezcano , randy.dunlap-QHcLZuEGTsvQT0dZR+AlfA@public.gmane.org, arnd-r2nGTMty4D4@public.gmane.org, linux-api-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, Containers , Nathan Lynch , linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, Louis.Rilling-aw0BnHfMbSpBDgjK7y7TUQ@public.gmane.org, kosaki.motohiro-+CUm20s59erQFUHtdCDX3A@public.gmane.org, hpa-YMNOUZJC4hwAvxtiuMwx3w@public.gmane.org, mingo-X9Un+BFzKDI@public.gmane.org, torvalds-de/tnXTf+JLsfHDXvbKv3WD2FQJk+8+b@public.gmane.org, Alexey Dobriyan , roland-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org, Pavel Emelyanov List-Id: linux-api@vger.kernel.org Eric W. Biederman [ebiederm-aS9lmoZGLiVWk0Htik3J/w@public.gmane.org] wrote: | > +static int set_pidmap(struct pid_namespace *pid_ns, int target) | > +{ | > + if (!target) | > + return alloc_pidmap(pid_ns); BTW, we need this now that the RESERVED_PIDS check is is conditional on ->last_pid. But this makes set_pidmap() completely general so should we have alloc_pid() call set_pidmap() always ? Or we could move this check into alloc_pid(), but it may be better to have all values of 'target' checked in one place. | > + | > + if (target >= pid_max) | > + return -EINVAL; | > + | > + if ((target < 0) || (target < RESERVED_PIDS && pid_ns == &init_pid_ns)) | > + return -EINVAL; | | if ((target < 0) || ((target < RESERVED_PIDS) && (pid_ns->last_pid >= RESERVED_PIDS))) | | Please. Ok.