Skip to content

Call vfork through libc only#1144

Merged
trcrsired merged 2 commits intocppfastio:nextfrom
aleck099:ak
Apr 24, 2025
Merged

Call vfork through libc only#1144
trcrsired merged 2 commits intocppfastio:nextfrom
aleck099:ak

Conversation

@aleck099
Copy link
Copy Markdown
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