Skip to content

Call vfork through libc only #1144

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Apr 24, 2025
Merged

Call vfork through libc only #1144

merged 2 commits into from
Apr 24, 2025

Conversation

aleck099
Copy link
Collaborator

The libc syscall() function does not handle vfork correctly
The vfork syscall is similar to fork, as it returns both in the child process and the parent process
The key difference is that the child process created by vfork shares the address space with the parent until an _exit or execve syscall is executed
This means even a simple function return in the child process can corrupt the parent's memory
The vfork api in libc is specially designed to back up and restore critical memory during a vfork syscall, which makes it irreplaceable by fast_io

@trcrsired trcrsired merged commit bb995b4 into cppfastio:next Apr 24, 2025
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants