aboutsummaryrefslogtreecommitdiffstats
path: root/executor
diff options
context:
space:
mode:
Diffstat (limited to 'executor')
-rw-r--r--executor/test.h7
-rw-r--r--executor/test_linux.h16
2 files changed, 21 insertions, 2 deletions
diff --git a/executor/test.h b/executor/test.h
index ba318dece..8997ef52f 100644
--- a/executor/test.h
+++ b/executor/test.h
@@ -1,7 +1,7 @@
// 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.
-#if GOOS_linux && (GOARCH_amd64 | GOARCH_ppc64 | GOARCH_ppc64le)
+#if GOOS_linux && (GOARCH_amd64 || GOARCH_ppc64 || GOARCH_ppc64le || GOARCH_arm64)
#include "test_linux.h"
#endif
@@ -372,9 +372,12 @@ static struct {
{"test_copyin", test_copyin},
{"test_csum_inet", test_csum_inet},
{"test_csum_inet_acc", test_csum_inet_acc},
-#if GOOS_linux && (GOARCH_amd64 || GOARCH_ppc64 || GOARCH_ppc64le)
+#if GOOS_linux && (GOARCH_amd64 || GOARCH_ppc64 || GOARCH_ppc64le || GOARCH_arm64)
{"test_kvm", test_kvm},
#endif
+#if GOOS_linux && GOARCH_arm64
+ {"test_syzos", test_syzos},
+#endif
{"test_cover_filter", test_cover_filter},
{"test_glob", test_glob},
};
diff --git a/executor/test_linux.h b/executor/test_linux.h
index 8c9493539..6d36d201e 100644
--- a/executor/test_linux.h
+++ b/executor/test_linux.h
@@ -304,3 +304,19 @@ static int cpu_feature_enabled(uint32_t function, uint32_t eax_bits, uint32_t eb
return 0;
}
#endif
+
+#ifdef GOARCH_arm64
+static int test_syzos()
+{
+ int mem_size = SYZ_PAGE_SIZE * 4;
+ void* mem = mmap(0, mem_size, PROT_READ | PROT_WRITE, MAP_PRIVATE | MAP_ANONYMOUS, -1, 0);
+ if (mem == MAP_FAILED) {
+ printf("mmap failed (%d)\n", errno);
+ return 1;
+ }
+ // Right now SyzOS testing just boils down to installing code into memory.
+ install_syzos_code(mem, mem_size);
+ munmap(mem, mem_size);
+ return 0;
+}
+#endif