All of lore.kernel.org
 help / color / mirror / Atom feed
* Question: copy_process() and CLONE_NEWNS
@ 2013-02-01  6:24 Kevin Wilson
  2013-02-01 11:58 ` Tobias Boege
  2013-02-01 12:22 ` Denis Kirjanov
  0 siblings, 2 replies; 4+ messages in thread
From: Kevin Wilson @ 2013-02-01  6:24 UTC (permalink / raw)
  To: kernelnewbies

Hi all,
question:

In copy_process() we have:

static struct task_struct *copy_process(unsigned long clone_flags,
                                         unsigned long stack_start,
                                         struct pt_regs *regs,
                                         unsigned long stack_size,
                                         int __user *child_tidptr,
                                         struct pid *pid,
                                         int trace)
 {
         int retval;
         struct task_struct *p;
         int cgroup_callbacks_done = 0;

         if ((clone_flags & (CLONE_NEWNS|CLONE_FS)) == (CLONE_NEWNS|CLONE_FS))
                 return ERR_PTR(-EINVAL);
 ...
...


see :http://lxr.free-electrons.com/source/kernel/fork.c#L1128

Why is the CLONE_NEWNS, when set, cause an error in copy_process(), as
shown above ?
is it not permitted that CLONE_NEWNS will be set ?

rgs,
Kevin

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Question: copy_process() and CLONE_NEWNS
  2013-02-01  6:24 Question: copy_process() and CLONE_NEWNS Kevin Wilson
@ 2013-02-01 11:58 ` Tobias Boege
  2013-02-04 16:21   ` Valdis.Kletnieks at vt.edu
  2013-02-01 12:22 ` Denis Kirjanov
  1 sibling, 1 reply; 4+ messages in thread
From: Tobias Boege @ 2013-02-01 11:58 UTC (permalink / raw)
  To: kernelnewbies

On Fri, 01 Feb 2013, Kevin Wilson wrote:
> Hi all,
> question:
> 
> In copy_process() we have:
> 
> static struct task_struct *copy_process(unsigned long clone_flags,
>                                          unsigned long stack_start,
>                                          struct pt_regs *regs,
>                                          unsigned long stack_size,
>                                          int __user *child_tidptr,
>                                          struct pid *pid,
>                                          int trace)
>  {
>          int retval;
>          struct task_struct *p;
>          int cgroup_callbacks_done = 0;
> 
>          if ((clone_flags & (CLONE_NEWNS|CLONE_FS)) == (CLONE_NEWNS|CLONE_FS))
>                  return ERR_PTR(-EINVAL);
>  ...
> ...
> 
> 
> see :http://lxr.free-electrons.com/source/kernel/fork.c#L1128
> 
> Why is the CLONE_NEWNS, when set, cause an error in copy_process(), as
> shown above ?
> is it not permitted that CLONE_NEWNS will be set ?

It seems so :-)

clone(2)'s manpage also says:

"It is not permitted to specify both CLONE_NEWNS and CLONE_FS in the same
clone() call."

Regards,
Tobi

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Question: copy_process() and CLONE_NEWNS
  2013-02-01  6:24 Question: copy_process() and CLONE_NEWNS Kevin Wilson
  2013-02-01 11:58 ` Tobias Boege
@ 2013-02-01 12:22 ` Denis Kirjanov
  1 sibling, 0 replies; 4+ messages in thread
From: Denis Kirjanov @ 2013-02-01 12:22 UTC (permalink / raw)
  To: kernelnewbies

On 2/1/13, Kevin Wilson <wkevils@gmail.com> wrote:
> Hi all,
> question:
>
> In copy_process() we have:
>
> static struct task_struct *copy_process(unsigned long clone_flags,
>                                          unsigned long stack_start,
>                                          struct pt_regs *regs,
>                                          unsigned long stack_size,
>                                          int __user *child_tidptr,
>                                          struct pid *pid,
>                                          int trace)
>  {
>          int retval;
>          struct task_struct *p;
>          int cgroup_callbacks_done = 0;
>
>          if ((clone_flags & (CLONE_NEWNS|CLONE_FS)) ==
> (CLONE_NEWNS|CLONE_FS))
>                  return ERR_PTR(-EINVAL);
>  ...
> ...
>

man unshare



> see :http://lxr.free-electrons.com/source/kernel/fork.c#L1128
>
> Why is the CLONE_NEWNS, when set, cause an error in copy_process(), as
> shown above ?
> is it not permitted that CLONE_NEWNS will be set ?
>
> rgs,
> Kevin
>
> _______________________________________________
> Kernelnewbies mailing list
> Kernelnewbies at kernelnewbies.org
> http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies
>


-- 
Regards,
Denis

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Question: copy_process() and CLONE_NEWNS
  2013-02-01 11:58 ` Tobias Boege
@ 2013-02-04 16:21   ` Valdis.Kletnieks at vt.edu
  0 siblings, 0 replies; 4+ messages in thread
From: Valdis.Kletnieks at vt.edu @ 2013-02-04 16:21 UTC (permalink / raw)
  To: kernelnewbies

On Fri, 01 Feb 2013 12:58:01 +0100, Tobias Boege said:

> clone(2)'s manpage also says:
>
> "It is not permitted to specify both CLONE_NEWNS and CLONE_FS in the same
> clone() call."

Mostly because nobody's ever figured out what the actual semantics of
having both of them set would be. :)
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 865 bytes
Desc: not available
Url : http://lists.kernelnewbies.org/pipermail/kernelnewbies/attachments/20130204/75a40a7e/attachment.bin 

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2013-02-04 16:21 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-02-01  6:24 Question: copy_process() and CLONE_NEWNS Kevin Wilson
2013-02-01 11:58 ` Tobias Boege
2013-02-04 16:21   ` Valdis.Kletnieks at vt.edu
2013-02-01 12:22 ` Denis Kirjanov

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.