executor: fix pid check after fork

This commit is contained in:
Dmitry Vyukov 2018-06-29 11:45:59 +02:00
parent 5adb8b7437
commit 346edcb763
2 changed files with 4 additions and 4 deletions

View File

@ -1218,7 +1218,7 @@ static int do_sandbox_none(void)
debug("unshare(CLONE_NEWPID): %d\n", errno);
}
int pid = fork();
if (pid <= 0)
if (pid != 0)
return wait_for_loop(pid);
#if defined(SYZ_EXECUTOR) || defined(SYZ_ENABLE_CGROUPS)
@ -1246,7 +1246,7 @@ static int do_sandbox_setuid(void)
if (unshare(CLONE_NEWPID))
fail("unshare(CLONE_NEWPID)");
int pid = fork();
if (pid <= 0)
if (pid != 0)
return wait_for_loop(pid);
#if defined(SYZ_EXECUTOR) || defined(SYZ_ENABLE_CGROUPS)

View File

@ -2251,7 +2251,7 @@ static int do_sandbox_none(void)
debug("unshare(CLONE_NEWPID): %d\n", errno);
}
int pid = fork();
if (pid <= 0)
if (pid != 0)
return wait_for_loop(pid);
#if defined(SYZ_EXECUTOR) || defined(SYZ_ENABLE_CGROUPS)
@ -2279,7 +2279,7 @@ static int do_sandbox_setuid(void)
if (unshare(CLONE_NEWPID))
fail("unshare(CLONE_NEWPID)");
int pid = fork();
if (pid <= 0)
if (pid != 0)
return wait_for_loop(pid);
#if defined(SYZ_EXECUTOR) || defined(SYZ_ENABLE_CGROUPS)