diff options
| author | Dan Austin <danielaustin@google.com> | 2018-08-03 13:10:54 -0700 |
|---|---|---|
| committer | Dmitry Vyukov <dvyukov@google.com> | 2018-08-08 11:03:33 +0200 |
| commit | 14f8a76fe729bddfcc96913fa4f7821f163144ac (patch) | |
| tree | 078c0ab4e8889335ba0be4b02662295b7dd5aadc | |
| parent | 1beb81367ce08594953fd11d686589b9613c3a97 (diff) | |
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.
| -rw-r--r-- | CONTRIBUTORS | 1 | ||||
| -rw-r--r-- | executor/common_linux.h | 9 | ||||
| -rw-r--r-- | pkg/csource/generated.go | 8 |
3 files changed, 9 insertions, 9 deletions
diff --git a/CONTRIBUTORS b/CONTRIBUTORS index 9e2c8005f..171fd854a 100644 --- a/CONTRIBUTORS +++ b/CONTRIBUTORS @@ -16,6 +16,7 @@ Google Inc. Eric Biggers Atul Prakash Julia Hansbrough + Dan Austin Baozeng Ding Lorenzo Stoakes Jeremy Huang 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 <fcntl.h> #include <sys/ioctl.h> #include <sys/stat.h> @@ -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 diff --git a/pkg/csource/generated.go b/pkg/csource/generated.go index 6960a1f94..ee719dc65 100644 --- a/pkg/csource/generated.go +++ b/pkg/csource/generated.go @@ -2946,9 +2946,6 @@ static void setup_common() setup_cgroups(); setup_binfmt_misc(); #endif -#if SYZ_EXECUTOR || SYZ_RESET_NET_NAMESPACE - checkpoint_net_namespace(); -#endif } #endif @@ -3377,7 +3374,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 <fcntl.h> #include <sys/ioctl.h> #include <sys/stat.h> @@ -3416,6 +3413,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 |
