Skip to content
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

clone(2): fix check for attempts to create new process #1733

Merged
merged 1 commit into from
Jun 3, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/unix/thread.c
Original file line number Diff line number Diff line change
Expand Up @@ -60,8 +60,8 @@ sysreturn clone(unsigned long flags, void *child_stack, int *ptid, unsigned long
thread_log(current, "clone: flags %lx, child_stack %p, ptid %p, ctid %p, newtls %lx",
flags, child_stack, ptid, ctid, newtls);

if (!child_stack) { /* this is actually a fork() */
thread_log(current, "attempted to fork by passing null child stack, aborting.");
if (!(flags & CLONE_THREAD)) {
thread_log(current, "attempted to create new process, aborting.");
return set_syscall_error(current, ENOSYS);
}

Expand Down