From 14f8a76fe729bddfcc96913fa4f7821f163144ac Mon Sep 17 00:00:00 2001 From: Dan Austin Date: Fri, 3 Aug 2018 13:10:54 -0700 Subject: executor: checkpoint net namespace in the right namespace With checkpoint_net_namespace moved to setup_common, and Android fuzzing session terminates prematurely due to ipv4_tables not being initialized at this time. Moving the call back to loop fixes this behavior. --- executor/common_linux.h | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) (limited to 'executor/common_linux.h') diff --git a/executor/common_linux.h b/executor/common_linux.h index 7f6b799cf..9ab092efc 100644 --- a/executor/common_linux.h +++ b/executor/common_linux.h @@ -1436,10 +1436,6 @@ static void setup_common() setup_cgroups(); setup_binfmt_misc(); #endif -#if SYZ_EXECUTOR || SYZ_RESET_NET_NAMESPACE - // TODO(dvukov): we do this in the wrong net namespace. Does this matter? - checkpoint_net_namespace(); -#endif } #endif @@ -1917,7 +1913,7 @@ static void kill_and_wait(int pid, int* status) } #endif -#if SYZ_EXECUTOR || SYZ_REPEAT && SYZ_ENABLE_CGROUPS +#if SYZ_EXECUTOR || SYZ_REPEAT && (SYZ_ENABLE_CGROUPS || SYZ_RESET_NET_NAMESPACE) #include #include #include @@ -1956,6 +1952,9 @@ static void setup_loop() debug("write(%s) failed: %d\n", procs_file, errno); } #endif +#if SYZ_EXECUTOR || SYZ_RESET_NET_NAMESPACE + checkpoint_net_namespace(); +#endif } #endif -- cgit mrf-deployment