Skip to content

Implement fork#3112

Merged
sporksmith merged 25 commits intoshadow:mainfrom
sporksmith:fork-v3
Aug 21, 2023
Merged

Implement fork#3112
sporksmith merged 25 commits intoshadow:mainfrom
sporksmith:fork-v3

Conversation

@sporksmith
Copy link
Copy Markdown
Contributor

No description provided.

@sporksmith sporksmith self-assigned this Aug 18, 2023
@github-actions github-actions bot added Component: Libraries Support functions like LD_PRELOAD and logging Component: Testing Unit and integration tests and frameworks Component: Main Composing the core Shadow executable Component: Build Build/install tools and dependencies labels Aug 18, 2023
@sporksmith sporksmith linked an issue Aug 18, 2023 that may be closed by this pull request
@sporksmith sporksmith force-pushed the fork-v3 branch 4 times, most recently from 242ed08 to 11b6dfa Compare August 18, 2023 19:54
After forking we still have the previously allocated signal stack in
thread local storage, but we still need to to install it for the new
thread/process.
Unlike when creating a new thread, when we create a new process the
child process finishes the shim-side syscall handling normally instead
of long-jumping back to the point of the original syscall. We handle
this on the shadow side by validating the native clone syscall result
and propating that back to finish the virtualized clone syscall.
The fork libc function actually uses the clone syscall with
CLONE_CHILD_CLEARTID and CLONE_CHILD_SETTID, so those needed to be
implemented as well.
@github-actions github-actions bot added the Component: Documentation In-repository documentation, under docs/ label Aug 21, 2023
@sporksmith sporksmith enabled auto-merge August 21, 2023 18:30
@sporksmith sporksmith merged commit e9f7bbb into shadow:main Aug 21, 2023
@sporksmith sporksmith deleted the fork-v3 branch August 21, 2023 18:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Component: Build Build/install tools and dependencies Component: Documentation In-repository documentation, under docs/ Component: Libraries Support functions like LD_PRELOAD and logging Component: Main Composing the core Shadow executable Component: Testing Unit and integration tests and frameworks

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Implement fork + equivalent clone/clone3

2 participants