Blame SOURCES/valgrind-3.17.0-clone-parent-res.patch

8febcd
commit e08a82991a9b9dc87c13f2b89273f25f97d14baf
8febcd
Author: Tom Hughes <tom@compton.nu>
8febcd
Date:   Tue Apr 6 22:44:36 2021 +0100
8febcd
8febcd
    Only process clone results in the parent thread
8febcd
    
8febcd
    Fixes BZ#423963
8febcd
8febcd
diff --git a/coregrind/m_syswrap/syswrap-linux.c b/coregrind/m_syswrap/syswrap-linux.c
8febcd
index 5ae4e6613..c59d8ee26 100644
8febcd
--- a/coregrind/m_syswrap/syswrap-linux.c
8febcd
+++ b/coregrind/m_syswrap/syswrap-linux.c
8febcd
@@ -940,7 +940,7 @@ PRE(sys_clone)
8febcd
          ("Valgrind does not support general clone().");
8febcd
    }
8febcd
 
8febcd
-   if (SUCCESS) {
8febcd
+   if (SUCCESS && RES != 0) {
8febcd
       if (ARG_FLAGS & (VKI_CLONE_PARENT_SETTID | VKI_CLONE_PIDFD))
8febcd
          POST_MEM_WRITE(ARG3, sizeof(Int));
8febcd
       if (ARG_FLAGS & (VKI_CLONE_CHILD_SETTID | VKI_CLONE_CHILD_CLEARTID))