All of lore.kernel.org
 help / color / mirror / Atom feed
From: Oren Laadan <orenl-eQaUEPhvms7ENvBUuze7eA@public.gmane.org>
To: "Serge E. Hallyn" <serue-r/Jw6+rmf7HQT0dZR+AlfA@public.gmane.org>
Cc: Linux Containers
	<containers-qjLDD68F18O7TbgM5vRIOg@public.gmane.org>,
	Cedric Le Goater <clg-NmTC/0ZBporQT0dZR+AlfA@public.gmane.org>,
	Pavel Emelyanov <xemul-GEFAQzZX7r8dnm+yROfE0A@public.gmane.org>
Subject: Re: Namespaces exhausted CLONE_XXX bits problem
Date: Mon, 14 Jan 2008 16:36:13 -0500	[thread overview]
Message-ID: <478BD5CD.7030607@cs.columbia.edu> (raw)
In-Reply-To: <20080114180748.GA2772-6s5zFf/epYLPQpwDFJZrxKsjOiXwFzmk@public.gmane.org>



Serge E. Hallyn wrote:
> Quoting Pavel Emelyanov (xemul-GEFAQzZX7r8dnm+yROfE0A@public.gmane.org):
>> Serge E. Hallyn wrote:
>>> Quoting Cedric Le Goater (clg-NmTC/0ZBporQT0dZR+AlfA@public.gmane.org):
>>>> to be more precise :
>>>>
>>>> 	long sys_clone_something(struct clone_something_args args) 
>>>>
>>>> and 
>>>>
>>>> 	long sys_unshare_something(struct unshare_something_args args) 
>>>>
>>>> The arg passing will be slower bc of the copy_from_user() but we will 
>>>> still have the sys_clone syscall for the fast path.
>>>>
>>>> C.
>>> I'm fine with the direction you're going, but just as one more option,
>>> we could follow more of the selinux/lsm approach of first requesting
>>> clone/unshare options, then doing the actual clone/unshare.  So
>>> something like
>>>
>>> 	sys_clone_request(extended_64bit_clone_flags)
>> What if we someday hit the 64-bit limit? :)
>>
>>> 	sys_clone(usual args)

One (security ?) problem with a two stage approach is that the operation
may not be completed in an atomic manner; e.g. if there are two threads
doing the first call before any of them gets to the second call. Or at
least ensure that such races cannot occur by design. (In contrast, with
sys_indirect() everything is atomic).

Also, in a two-step approach, using /proc as opposed to a specialized
system call incurs higher overhead should ultra-fast clone()s are a
goal by itself.

I second the concern of running out of 64 bits of flags. In fact, the
problem with the flags is likely to be valid outside our context, and
general to the linux kernel soon. Should we not discuss it there too ?

>>>
>>> or
>>>
>>> 	echo pid,mqueue,user,ipc,uts,net > /proc/self/clone_unshare
>>> 	clone()
>> Well, this is how sys_indirect() was intended to work. Nobody
>> liked it, so I'm afraid this will also not be accepted.
> 
> I would have thought sys_indirect would be disliked because
> it looks like an ioctl type multiplexor.  Whereas sys_clone_request()
> or /proc/self/clone_unshare simply sets arguments in advance, the
> way /proc/self/attr/current does.

I find the sys_indirect() approach very appealing, in particular
because it is designed and motivated by a non-ioctl multiplexing
and backward compatibility in mind. Like any API it can be abused
and misused, but since it applies to actual system calls and not
obscured ioctl, it is far less likely to become a victim (so to
speak ...).

While I prefer the sys_indirect() (personally I find it elegant,
but it isn't clear that it will be merged), from a technical point
of view any of new system call, sys_indirect() or a 2-step approach
approach - all three seem plausible. The final solution, however
needs to be coordinated with the rest of the kernel developers.

Oren.

> 
> -serge
> _______________________________________________
> Containers mailing list
> Containers-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA@public.gmane.org
> https://lists.linux-foundation.org/mailman/listinfo/containers

  parent reply	other threads:[~2008-01-14 21:36 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-01-14 13:45 Namespaces exhausted CLONE_XXX bits problem Pavel Emelyanov
     [not found] ` <478B6764.6050300-GEFAQzZX7r8dnm+yROfE0A@public.gmane.org>
2008-01-14 14:44   ` Cedric Le Goater
     [not found]     ` <478B7549.2020000-NmTC/0ZBporQT0dZR+AlfA@public.gmane.org>
2008-01-14 14:50       ` Pavel Emelyanov
     [not found]         ` <478B76C4.8050804-GEFAQzZX7r8dnm+yROfE0A@public.gmane.org>
2008-01-14 15:20           ` Cedric Le Goater
     [not found]             ` <478B7DB3.9050702-NmTC/0ZBporQT0dZR+AlfA@public.gmane.org>
2008-01-14 16:32               ` Serge E. Hallyn
     [not found]                 ` <20080114163246.GA31663-6s5zFf/epYLPQpwDFJZrxKsjOiXwFzmk@public.gmane.org>
2008-01-14 16:52                   ` Pavel Emelyanov
     [not found]                     ` <478B9345.30004-GEFAQzZX7r8dnm+yROfE0A@public.gmane.org>
2008-01-14 18:07                       ` Serge E. Hallyn
     [not found]                         ` <20080114180748.GA2772-6s5zFf/epYLPQpwDFJZrxKsjOiXwFzmk@public.gmane.org>
2008-01-14 21:36                           ` Oren Laadan [this message]
     [not found]                             ` <478BD5CD.7030607-eQaUEPhvms7ENvBUuze7eA@public.gmane.org>
2008-01-14 21:54                               ` Dave Hansen
2008-01-15  8:25                                 ` Pavel Emelyanov
     [not found]                                   ` <478C6E14.1050901-GEFAQzZX7r8dnm+yROfE0A@public.gmane.org>
2008-01-15  8:39                                     ` Cedric Le Goater
     [not found]                                       ` <478C7156.2090004-NmTC/0ZBporQT0dZR+AlfA@public.gmane.org>
2008-01-15  8:53                                         ` Pavel Emelyanov
     [not found]                                           ` <478C7493.8070405-GEFAQzZX7r8dnm+yROfE0A@public.gmane.org>
2008-01-15  9:40                                             ` Cedric Le Goater
     [not found]                                               ` <478C7F95.6050800-NmTC/0ZBporQT0dZR+AlfA@public.gmane.org>
2008-01-15  9:57                                                 ` Pavel Emelyanov
2008-01-15  9:22                                     ` Dave Hansen
2008-01-15  9:24                                       ` Pavel Emelyanov
     [not found]                                         ` <478C7BD1.7040905-GEFAQzZX7r8dnm+yROfE0A@public.gmane.org>
2008-01-15 15:08                                           ` Serge E. Hallyn
     [not found]                                             ` <20080115150806.GH4453-6s5zFf/epYLPQpwDFJZrxKsjOiXwFzmk@public.gmane.org>
2008-01-15 15:51                                               ` Cedric Le Goater
2008-01-15  7:53                   ` Cedric Le Goater
     [not found]                     ` <478C665C.80106-NmTC/0ZBporQT0dZR+AlfA@public.gmane.org>
2008-01-15 14:35                       ` Serge E. Hallyn

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=478BD5CD.7030607@cs.columbia.edu \
    --to=orenl-eqauephvms7envbuuze7ea@public.gmane.org \
    --cc=clg-NmTC/0ZBporQT0dZR+AlfA@public.gmane.org \
    --cc=containers-qjLDD68F18O7TbgM5vRIOg@public.gmane.org \
    --cc=serue-r/Jw6+rmf7HQT0dZR+AlfA@public.gmane.org \
    --cc=xemul-GEFAQzZX7r8dnm+yROfE0A@public.gmane.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.