DescriptionUse the libc clone wrapper in sys_clone.
Previously, we directly invoked the syscall, which would not update
libc's PID cache in the child. Although the libc wrapper function
updates the PID cache, it unfortunately requires that the child run on a
different stack, even if CLONE_VM is not specified. We work around this
by briefly switching stacks in the child, then using longjmp to switch
back. This gives us a version of clone with fork-like behavior, which is
what we need for starting processes in new namespaces.
BUG=312380
Committed: https://crrev.com/d8a593bceaf0a4b38d06a8c13b948202d205f1b6
Cr-Commit-Position: refs/heads/master@{#308510}
Patch Set 1 #Patch Set 2 : Rebase #
Total comments: 19
Patch Set 3 : Respond to comments. #Patch Set 4 : Hardcode supported architectures. #Patch Set 5 : Fix typo. #
Total comments: 1
Patch Set 6 : Use macros from build_config.h #
Messages
Total messages: 14 (2 generated)
|