]> git.ipfire.org Git - thirdparty/valgrind.git/commitdiff
Allow clone with CLONE_VFORK and no CLONE_VM
authorTom Hughes <tom@compton.nu>
Thu, 20 Feb 2020 09:14:24 +0000 (09:14 +0000)
committerTom Hughes <tom@compton.nu>
Thu, 20 Feb 2020 09:14:24 +0000 (09:14 +0000)
The CLONE_VFORK flag causes the parent to suspend until the child
exits or execs so without the memory sharing CLONE_VM would give
this is really closer to fork but we convert vfork to fork by
removing CLONE_VM anyway so there is no reason not to allow this.

Fixes BZ#417906

NEWS
coregrind/m_syswrap/syswrap-linux.c

diff --git a/NEWS b/NEWS
index 99ece46f62b701e9eb798e4f8b47cde4debbe1d4..07dd91489f9250de09f2c021951126156fa1ff64 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -117,6 +117,7 @@ n-i-bz  sys_statx: don't complain if both |filename| and |buf| are NULL.
 n-i-bz  Fix non-glibc build of test suite with s390x_features
 416667  gcc10 ppc64le impossible constraint in 'asm' in test_isa.
 417452  s390_insn_store_emit: dst->tag for HRcVec128
+417906  clone with CLONE_VFORK and no CLONE_VM fails
 
 
 Release 3.15.0 (12 April 2019)
index bc09628fd0fb1e806649e8f9ad15d16dfb5f03d0..a4c106f684a5504ed5cb83f748a06fbc38ddac5c 100644 (file)
@@ -915,6 +915,7 @@ PRE(sys_clone)
       break;
 
    case VKI_CLONE_VFORK | VKI_CLONE_VM: /* vfork */
+   case VKI_CLONE_VFORK: /* vfork without memory sharing */
       cloneflags &= ~VKI_CLONE_VM;
       // FALLTHROUGH - assume vfork (somewhat) == fork, see ML_(do_fork_clone).