• Austin Clements's avatar
    syscall: use CLONE_VFORK safely · 67e53754
    Austin Clements authored
    Currently, CLONE_VFORK is used without much regard to the stack. This
    is dangerous, because anything the child does to the stack is visible
    to the parent. For example, if the compiler were to reuse named stack
    slots (which it currently doesn't do), it would be easy for the child
    running in the same stack frame as the parent to corrupt local
    variables that the parent then depended on. We're not sure of anything
    specific going wrong in this code right now, but it is at best a
    ticking time bomb.
    
    CLONE_VFORK can only safely be used if we ensure the child does not
    execute in any of the active stack frames of the parent. This commit
    implements this by arranging for the parent to return immediately from
    the frame the child will operate in, and for the child to never return
    to the frame the parent will operate in.
    
    Fixes #20732.
    
    Change-Id: Iad5b4ddc2b994c082bd278bfd52ef53bd38c037f
    Reviewed-on: https://go-review.googlesource.com/46173
    Run-TryBot: Austin Clements <austin@google.com>
    TryBot-Result: Gobot Gobot <gobot@golang.org>
    Reviewed-by: 's avatarIan Lance Taylor <iant@golang.org>
    67e53754
Name
Last commit
Last update
.github Loading commit data...
api Loading commit data...
doc Loading commit data...
lib/time Loading commit data...
misc Loading commit data...
src Loading commit data...
test Loading commit data...
.gitattributes Loading commit data...
.gitignore Loading commit data...
AUTHORS Loading commit data...
CONTRIBUTING.md Loading commit data...
CONTRIBUTORS Loading commit data...
LICENSE Loading commit data...
PATENTS Loading commit data...
README.md Loading commit data...
favicon.ico Loading commit data...
robots.txt Loading commit data...