From f3d9d5948cad441ab08e763c8ed86efe79f4198b Mon Sep 17 00:00:00 2001 From: Greg Steuck Date: Tue, 11 Dec 2018 14:30:49 -0800 Subject: pkg/csource: support tun and setuid repros on {free,open}bsd * expose procid on BSD for tun, always declare loop() * deal with terrible bsd includes * replicate loop() declaration --- executor/common.h | 3 ++- executor/common_bsd.h | 7 ++++++- 2 files changed, 8 insertions(+), 2 deletions(-) (limited to 'executor') diff --git a/executor/common.h b/executor/common.h index 7e855b91c..6823c6ba4 100644 --- a/executor/common.h +++ b/executor/common.h @@ -40,7 +40,8 @@ NORETURN void doexit(int status) #endif #if SYZ_EXECUTOR || SYZ_PROCS || SYZ_REPEAT && SYZ_ENABLE_CGROUPS || \ - __NR_syz_mount_image || __NR_syz_read_part_table + __NR_syz_mount_image || __NR_syz_read_part_table || \ + (GOOS_openbsd || GOOS_freebsd) && SYZ_TUN_ENABLE unsigned long long procid; #endif diff --git a/executor/common_bsd.h b/executor/common_bsd.h index 53ffc8668..0dcf6ff5f 100644 --- a/executor/common_bsd.h +++ b/executor/common_bsd.h @@ -211,7 +211,8 @@ struct tcp_resources { #include #include -// Include order matters, empty line prevent re-sorting. +// Include order matters, empty line prevent re-sorting. See a workaround in +// pkg/csource hoistIncludes. #include static long syz_extract_tcp_res(long a0, long a1, long a2) @@ -299,7 +300,9 @@ static void sandbox_common() #endif // SYZ_EXECUTOR || SYZ_SANDBOX_SETUID || SYZ_SANDBOX_NONE #if SYZ_EXECUTOR || SYZ_SANDBOX_NONE + static void loop(); + static int do_sandbox_none(void) { sandbox_common(); @@ -317,6 +320,8 @@ static int do_sandbox_none(void) #include #include +static void loop(); + static int wait_for_loop(int pid) { if (pid < 0) -- cgit mrf-deployment