diff options
| author | Dmitry Vyukov <dvyukov@google.com> | 2024-04-15 10:37:30 +0200 |
|---|---|---|
| committer | Dmitry Vyukov <dvyukov@google.com> | 2024-04-15 10:19:39 +0000 |
| commit | c6f10907c38ce49ddc321539f75aabf0a9ad6c71 (patch) | |
| tree | 1277a1d64e2201b58b550ef0131222eaab9fcf73 /executor | |
| parent | 33fec5a3ec55bce7f1664e70e6f5ff8daf56886d (diff) | |
all: remove akaros support
Akaros support is unused, it was shutdown on syzbot for a while,
the akaros development seems to be frozen for years as well.
We have a bunch of hacks for Akaros since it supported
only super old gcc and haven't supported Go. Remove it.
Diffstat (limited to 'executor')
| -rw-r--r-- | executor/common.h | 54 | ||||
| -rw-r--r-- | executor/common_akaros.h | 35 | ||||
| -rw-r--r-- | executor/executor.cc | 17 | ||||
| -rw-r--r-- | executor/executor_akaros.h | 25 |
4 files changed, 3 insertions, 128 deletions
diff --git a/executor/common.h b/executor/common.h index 0e986022c..bfe6c76a7 100644 --- a/executor/common.h +++ b/executor/common.h @@ -87,14 +87,6 @@ static __thread int clone_ongoing; static __thread int skip_segv; static __thread jmp_buf segv_env; -#if GOOS_akaros -#include <parlib/parlib.h> -static void recover(void) -{ - _longjmp(segv_env, 1); -} -#endif - static void segv_handler(int sig, siginfo_t* info, void* ctx) { // Generated programs can contain bad (unmapped/protected) addresses, @@ -130,13 +122,7 @@ static void segv_handler(int sig, siginfo_t* info, void* ctx) #endif if (skip && valid) { debug("SIGSEGV on %p, skipping\n", (void*)addr); -#if GOOS_akaros - struct user_context* uctx = (struct user_context*)ctx; - uctx->tf.hw_tf.tf_rip = (long)(void*)recover; - return; -#else _longjmp(segv_env, 1); -#endif } debug("SIGSEGV on %p, exiting\n", (void*)addr); doexit(sig); @@ -239,7 +225,7 @@ static void use_temporary_dir(void) #endif #endif -#if GOOS_akaros || GOOS_netbsd || GOOS_freebsd || GOOS_darwin || GOOS_openbsd || GOOS_test +#if GOOS_netbsd || GOOS_freebsd || GOOS_darwin || GOOS_openbsd || GOOS_test #if (SYZ_EXECUTOR || SYZ_REPEAT) && SYZ_EXECUTOR_USES_FORK_SERVER && (SYZ_EXECUTOR || SYZ_USE_TMP_DIR) #include <dirent.h> #include <errno.h> @@ -378,7 +364,7 @@ static void thread_start(void* (*fn)(void*), void* arg) #endif #endif -#if GOOS_freebsd || GOOS_darwin || GOOS_netbsd || GOOS_openbsd || GOOS_akaros || GOOS_test +#if GOOS_freebsd || GOOS_darwin || GOOS_netbsd || GOOS_openbsd || GOOS_test #if SYZ_EXECUTOR || SYZ_THREADED #include <pthread.h> @@ -493,9 +479,7 @@ static uint16 csum_inet_digest(struct csum_inet* csum) } #endif -#if GOOS_akaros -#include "common_akaros.h" -#elif GOOS_freebsd || GOOS_darwin || GOOS_netbsd +#if GOOS_freebsd || GOOS_darwin || GOOS_netbsd #include "common_bsd.h" #elif GOOS_openbsd #include "common_openbsd.h" @@ -635,13 +619,6 @@ static void loop(void) // Tell parent that we are ready to serve. reply_handshake(); #endif -#if SYZ_EXECUTOR && GOOS_akaros - // For akaros we do exec in the child process because new threads can't be created in the fork child. - // Thus we proxy input program over the child_pipe to the child process. - int child_pipe[2]; - if (pipe(child_pipe)) - fail("pipe failed"); -#endif int iter = 0; #if SYZ_REPEAT_TIMES for (; iter < /*{{{REPEAT_TIMES}}}*/; iter++) { @@ -675,15 +652,6 @@ static void loop(void) #if SYZ_HAVE_SETUP_EXT_TEST setup_ext_test(); #endif -#if GOOS_akaros -#if SYZ_EXECUTOR - dup2(child_pipe[0], kInPipeFd); - close(child_pipe[0]); - close(child_pipe[1]); -#endif - execl(program_name, program_name, "child", NULL); - fail("execl failed"); -#else #if SYZ_EXECUTOR close(kInPipeFd); #endif @@ -695,13 +663,9 @@ static void loop(void) close_fds(); #endif doexit(0); -#endif } debug("spawned worker pid %d\n", pid); -#if SYZ_EXECUTOR && GOOS_akaros - resend_execute(child_pipe[1]); -#endif // We used to use sigtimedwait(SIGCHLD) to wait for the subprocess. // But SIGCHLD is also delivered when a process stops/continues, // so it would require a loop with status analysis and timeout recalculation. @@ -799,21 +763,9 @@ void loop(void) #endif // This is the main function for csource. -#if GOOS_akaros && SYZ_REPEAT -#include <string.h> - -int main(int argc, char** argv) -{ - /*{{{MMAP_DATA}}}*/ - - program_name = argv[0]; - if (argc == 2 && strcmp(argv[1], "child") == 0) - child(); -#else int main(void) { /*{{{MMAP_DATA}}}*/ -#endif #if SYZ_SYSCTL setup_sysctl(); diff --git a/executor/common_akaros.h b/executor/common_akaros.h deleted file mode 100644 index 7886a4996..000000000 --- a/executor/common_akaros.h +++ /dev/null @@ -1,35 +0,0 @@ -// Copyright 2017 syzkaller project authors. All rights reserved. -// Use of this source code is governed by Apache 2 LICENSE that can be found in the LICENSE file. - -// This file is shared between executor and csource package. - -#include <ros/syscall.h> -#include <stdlib.h> -#include <unistd.h> - -#if SYZ_EXECUTOR || SYZ_SANDBOX_NONE -static void loop(); -static int do_sandbox_none(void) -{ - loop(); - return 0; -} -#endif - -#if SYZ_EXECUTOR || SYZ_REPEAT -static void execute_one(); -const char* program_name; - -void child() -{ -#if SYZ_EXECUTOR || SYZ_HANDLE_SEGV - install_segv_handler(); -#endif -#if SYZ_EXECUTOR - receive_execute(); - close(kInPipeFd); -#endif - execute_one(); - doexit(0); -} -#endif diff --git a/executor/executor.cc b/executor/executor.cc index 8b58287b1..267fac857 100644 --- a/executor/executor.cc +++ b/executor/executor.cc @@ -107,10 +107,6 @@ void debug_dump_data(const char* data, int length); static void receive_execute(); static void reply_execute(int status); -#if GOOS_akaros -static void resend_execute(int fd); -#endif - #if SYZ_EXECUTOR_USES_FORK_SERVER static void receive_handshake(); static void reply_handshake(); @@ -397,8 +393,6 @@ static void setup_features(char** enable, int n); #include "executor_linux.h" #elif GOOS_fuchsia #include "executor_fuchsia.h" -#elif GOOS_akaros -#include "executor_akaros.h" #elif GOOS_freebsd || GOOS_netbsd || GOOS_openbsd #include "executor_bsd.h" #elif GOOS_darwin @@ -712,17 +706,6 @@ bool cover_collection_required() return flag_coverage && (flag_collect_signal || flag_collect_cover || flag_comparisons); } -#if GOOS_akaros -void resend_execute(int fd) -{ - execute_req& req = last_execute_req; - if (write(fd, &req, sizeof(req)) != sizeof(req)) - fail("child pipe header write failed"); - if (write(fd, input_data, req.prog_size) != (ssize_t)req.prog_size) - fail("child pipe program write failed"); -} -#endif - void reply_execute(int status) { execute_reply reply = {}; diff --git a/executor/executor_akaros.h b/executor/executor_akaros.h deleted file mode 100644 index 82cae909d..000000000 --- a/executor/executor_akaros.h +++ /dev/null @@ -1,25 +0,0 @@ -// Copyright 2017 syzkaller project authors. All rights reserved. -// Use of this source code is governed by Apache 2 LICENSE that can be found in the LICENSE file. - -#include <stdio.h> -#include <stdlib.h> -#include <string.h> -#include <sys/mman.h> -#include <unistd.h> - -#include "nocover.h" - -static void os_init(int argc, char** argv, void* data, size_t data_size) -{ - program_name = argv[0]; - if (argc == 2 && strcmp(argv[1], "child") == 0) { - if (mmap(data, data_size, PROT_READ | PROT_WRITE | PROT_EXEC, MAP_ANON | MAP_PRIVATE | MAP_FIXED, -1, 0) != data) - fail("mmap of data segment failed"); - child(); - } -} - -static intptr_t execute_syscall(const call_t* c, intptr_t a[kMaxArgs]) -{ - return syscall(c->sys_nr, a[0], a[1], a[2], a[3], a[4], a[5], a[6], a[7], a[8]); -} |
