From mboxrd@z Thu Jan 1 00:00:00 1970 From: Pavel Emelyanov Subject: Re: [PATCH] An attempt to have an unlimitedly extendable sys_clone Date: Wed, 16 Jan 2008 11:09:06 +0300 Message-ID: <478DBBA2.6080202@openvz.org> References: <478CAC32.4080809@openvz.org> <39689.192.168.101.12.1200407681.squirrel@intranet> <478DB1AC.6050508@openvz.org> <41572.192.168.102.6.1200470331.squirrel@intranet> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <41572.192.168.102.6.1200470331.squirrel@intranet> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: containers-bounces-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA@public.gmane.org Errors-To: containers-bounces-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA@public.gmane.org To: Daniel Hokka Zakrisson Cc: Linux Containers , Cedric Le Goater List-Id: containers.vger.kernel.org Daniel Hokka Zakrisson wrote: > Pavel Emelyanov wrote: >> [snip] >> >>>> +static struct long_clone_arg *get_long_clone_arg(int __user >>>> *child_tidptr) >>>> +{ >>>> + int size; >>>> + struct long_clone_arg *carg; >>>> + >>>> + if (get_user(size, child_tidptr)) >>>> + return ERR_PTR(-EFAULT); >>>> + >>>> + if (size > sizeof(struct long_clone_arg)) >>>> + return ERR_PTR(-EINVAL); >>> This means that software built against a newer kernel won't work on an >>> older one. Surely that's not intended? >> It is intended. If I ask an old kernel to clone the mq namespace, but >> it doesn't support such, that I'd better like to get an -EINVAL error >> rather than be silently held in an old global namespace. > > That rules out using the struct for things like child_tidptr, the desired > pid for C/R, etc. I think the version Dave Hansen proposed would be A new system call? Ok - what arguments should it take? > better, or if it's really just for bits, use an array rather than a struct > to make that obvious. It's for anything you'd like to tell to clone(). In the nearest future - for more bits to clone new namespaces. In the far future - for pid to create the task with (for c/r jobs). In the the far-far future - for anything you will need then. >> [snip] >> >