aboutsummaryrefslogtreecommitdiffstats
path: root/csource
diff options
context:
space:
mode:
authorAndrey Konovalov <andreyknvl@google.com>2017-05-18 14:36:53 +0200
committerAndrey Konovalov <andreyknvl@google.com>2017-06-12 19:48:23 +0200
commitacae98dc5463f8aaa13013aab1aa80509d800fb7 (patch)
tree7bdedb7af98c8a17f445f8291cabad6143cdcc9e /csource
parent5597911fbf26237b9d11a0f6293e4b52b2d9069c (diff)
executor: don't define SYZ_ENABLE_TUN in executor
Diffstat (limited to 'csource')
-rw-r--r--csource/common.go22
1 files changed, 11 insertions, 11 deletions
diff --git a/csource/common.go b/csource/common.go
index 8fa531598..b748a555a 100644
--- a/csource/common.go
+++ b/csource/common.go
@@ -187,7 +187,7 @@ static void use_temporary_dir()
*(type*)(addr) = new_val; \
}
-#ifdef SYZ_TUN_ENABLE
+#if defined(SYZ_EXECUTOR) || defined(SYZ_TUN_ENABLE)
static void vsnprintf_check(char* str, size_t size, const char* format, va_list args)
{
int rv;
@@ -319,7 +319,7 @@ void debug_dump_data(const char* data, int length)
}
#endif
-#if (defined(__NR_syz_emit_ethernet) && defined(SYZ_TUN_ENABLE)) || defined(__NR_syz_test)
+#if defined(SYZ_EXECUTOR) || (defined(__NR_syz_emit_ethernet) && defined(SYZ_TUN_ENABLE)) || defined(__NR_syz_test)
struct csum_inet {
uint32_t acc;
};
@@ -351,7 +351,7 @@ uint16_t csum_inet_digest(struct csum_inet* csum)
}
#endif
-#if defined(__NR_syz_emit_ethernet) && defined(SYZ_TUN_ENABLE)
+#if defined(SYZ_EXECUTOR) || (defined(__NR_syz_emit_ethernet) && defined(SYZ_TUN_ENABLE))
static uintptr_t syz_emit_ethernet(uintptr_t a0, uintptr_t a1)
{
@@ -365,7 +365,7 @@ static uintptr_t syz_emit_ethernet(uintptr_t a0, uintptr_t a1)
}
#endif
-#if (defined(SYZ_EXECUTOR) || defined(SYZ_REPEAT)) && defined(SYZ_TUN_ENABLE)
+#if defined(SYZ_EXECUTOR) || (defined(SYZ_REPEAT) && defined(SYZ_TUN_ENABLE))
void flush_tun()
{
char data[SYZ_TUN_MAX_PACKET_SIZE];
@@ -374,7 +374,7 @@ void flush_tun()
}
#endif
-#if defined(__NR_syz_extract_tcp_res) && defined(SYZ_TUN_ENABLE)
+#if defined(SYZ_EXECUTOR) || (defined(__NR_syz_extract_tcp_res) && defined(SYZ_TUN_ENABLE))
struct ipv6hdr {
__u8 priority : 4,
version : 4;
@@ -1523,7 +1523,7 @@ static uintptr_t execute_syscall(int nr, uintptr_t a0, uintptr_t a1, uintptr_t a
#endif
#if defined(__NR_syz_emit_ethernet)
case __NR_syz_emit_ethernet:
-#if defined(SYZ_TUN_ENABLE)
+#if defined(SYZ_EXECUTOR) || defined(SYZ_TUN_ENABLE)
return syz_emit_ethernet(a0, a1);
#else
return 0;
@@ -1531,7 +1531,7 @@ static uintptr_t execute_syscall(int nr, uintptr_t a0, uintptr_t a1, uintptr_t a
#endif
#if defined(__NR_syz_extract_tcp_res)
case __NR_syz_extract_tcp_res:
-#if defined(SYZ_TUN_ENABLE)
+#if defined(SYZ_EXECUTOR) || defined(SYZ_TUN_ENABLE)
return syz_extract_tcp_res(a0, a1, a2);
#else
return 0;
@@ -1575,7 +1575,7 @@ static int do_sandbox_none(int executor_pid, bool enable_tun)
return pid;
sandbox_common();
-#ifdef SYZ_TUN_ENABLE
+#if defined(SYZ_EXECUTOR) || defined(SYZ_TUN_ENABLE)
setup_tun(executor_pid, enable_tun);
#endif
@@ -1592,7 +1592,7 @@ static int do_sandbox_setuid(int executor_pid, bool enable_tun)
return pid;
sandbox_common();
-#ifdef SYZ_TUN_ENABLE
+#if defined(SYZ_EXECUTOR) || defined(SYZ_TUN_ENABLE)
setup_tun(executor_pid, enable_tun);
#endif
@@ -1651,7 +1651,7 @@ static int namespace_sandbox_proc(void* arg)
if (!write_file("/proc/self/gid_map", "0 %d 1\n", real_gid))
fail("write of /proc/self/gid_map failed");
-#ifdef SYZ_TUN_ENABLE
+#if defined(SYZ_EXECUTOR) || defined(SYZ_TUN_ENABLE)
setup_tun(epid, etun);
#endif
@@ -1832,7 +1832,7 @@ void loop()
setpgrp();
if (chdir(cwdbuf))
fail("failed to chdir");
-#if defined(SYZ_TUN_ENABLE)
+#ifdef SYZ_TUN_ENABLE
flush_tun();
#endif
test();