Re: For review: documentation of clone3() system call

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Mon, Nov 11, 2019 at 4:03 PM Florian Weimer <fweimer@xxxxxxxxxx> wrote:
>
> * Michael Kerrisk:
>
> >        Another  difference  for  the  raw clone() system call is that the
> >        stack argument may be NULL, in which case the child uses a  dupli‐
> >        cate  of the parent's stack.  (Copy-on-write semantics ensure that
> >        the child gets separate copies of stack pages when either  process
> >        modifies  the  stack.)   In  this case, for correct operation, the
> >        CLONE_VM option should not be specified.  (If the child shares the
> >        parent's  memory  because of the use of the CLONE_VM flag, then no
> >        copy-on-write duplication occurs and chaos is likely to result.)
>
> I think sharing the stack also works with CLONE_VFORK with CLONE_VM, as
> long as measures are taken to preserve the return address in a register.

That basically just requires that the userspace function declaration
for clone3 includes __attribute__((returns_twice)), right?




[Index of Archives]     [Kernel Documentation]     [Netdev]     [Linux Ethernet Bridging]     [Linux Wireless]     [Kernel Newbies]     [Security]     [Linux for Hams]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux Admin]     [Samba]

  Powered by Linux