From: Tom Hughes Date: Thu, 20 Feb 2020 09:14:24 +0000 (+0000) Subject: Allow clone with CLONE_VFORK and no CLONE_VM X-Git-Tag: VALGRIND_3_16_0~99 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=3e11902ce28ff43cff679bf2453c597d568fde8f;p=thirdparty%2Fvalgrind.git Allow clone with CLONE_VFORK and no CLONE_VM 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 --- diff --git a/NEWS b/NEWS index 99ece46f62..07dd91489f 100644 --- 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) diff --git a/coregrind/m_syswrap/syswrap-linux.c b/coregrind/m_syswrap/syswrap-linux.c index bc09628fd0..a4c106f684 100644 --- a/coregrind/m_syswrap/syswrap-linux.c +++ b/coregrind/m_syswrap/syswrap-linux.c @@ -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).