From 4e2f4670362d2ab8eed55be0cf699b24d658c3e6 Mon Sep 17 00:00:00 2001 From: Thiago Macieira Date: Fri, 12 Jun 2020 21:40:42 -0700 Subject: forkfd: remove FFD_VFORK_SEMANTICS This will never work, not unless libc implements it themselves, since the child process is not allowed to return from the function that does the vfork(), as subsequent use of the stack would trash the frozen parent's return address, and in our case that's syscall(). Instead, we may add a vforkfd() function that takes a callback function that will be called in that context, like the glibc clone(3) wrapper does. Pick-to: 5.15 Change-Id: I1dba29bc0f454df09ca1fffd161800b453c00593 Reviewed-by: Edward Welbourne --- src/3rdparty/forkfd/forkfd_linux.c | 2 -- 1 file changed, 2 deletions(-) (limited to 'src/3rdparty/forkfd/forkfd_linux.c') diff --git a/src/3rdparty/forkfd/forkfd_linux.c b/src/3rdparty/forkfd/forkfd_linux.c index 0984368add..923ced128d 100644 --- a/src/3rdparty/forkfd/forkfd_linux.c +++ b/src/3rdparty/forkfd/forkfd_linux.c @@ -148,8 +148,6 @@ int system_forkfd(int flags, pid_t *ppid, int *system) *system = 1; unsigned long cloneflags = CLONE_PIDFD; - if (flags & FFD_VFORK_SEMANTICS) - cloneflags |= CLONE_VFORK; pid = sys_clone(cloneflags, &pidfd); if (pid < 0) return pid; -- cgit v1.2.3