aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--executor/common_linux.h4
1 files changed, 4 insertions, 0 deletions
diff --git a/executor/common_linux.h b/executor/common_linux.h
index 54dbdc8b2..562fe703b 100644
--- a/executor/common_linux.h
+++ b/executor/common_linux.h
@@ -4044,6 +4044,8 @@ static void loop();
static void sandbox_common()
{
prctl(PR_SET_PDEATHSIG, SIGKILL, 0, 0, 0);
+ if (getppid() == 1)
+ exitf("the sandbox parent process was killed");
#if SYZ_EXECUTOR || __NR_syz_init_net_socket || SYZ_DEVLINK_PCI || __NR_syz_socket_connect_nvme_tcp
int netns = open("/proc/self/ns/net", O_RDONLY);
@@ -4857,6 +4859,8 @@ static void reset_loop()
static void setup_test()
{
prctl(PR_SET_PDEATHSIG, SIGKILL, 0, 0, 0);
+ // We don't check for getppid() == 1 here b/c of unshare(CLONE_NEWPID),
+ // our parent is normally pid 1.
setpgrp();
#if SYZ_EXECUTOR || SYZ_CGROUPS
setup_cgroups_test();