From 539e603206f427ff6549cde661fef0205a4c9034 Mon Sep 17 00:00:00 2001 From: Dmitry Vyukov Date: Fri, 15 Sep 2017 10:15:00 +0200 Subject: syz-manager, syz-fuzzer, executor: ensure that binaries are consistent Check that manager/fuzzer/executor are build on the same git revision, use the same syscall descriptions and the same target arch. Update #336 --- executor/executor.cc | 9 +++++++++ executor/syscalls.h | 10 ++++++++++ 2 files changed, 19 insertions(+) (limited to 'executor') diff --git a/executor/executor.cc b/executor/executor.cc index 87a597253..ce8d0ed2f 100644 --- a/executor/executor.cc +++ b/executor/executor.cc @@ -228,8 +228,17 @@ uint64_t read_cover_size(thread_t* th); static uint32_t hash(uint32_t a); static bool dedup(uint32_t sig); +#ifndef GIT_REVISION +#define GIT_REVISION "unknown" +#endif + int main(int argc, char** argv) { + if (argc == 2 && strcmp(argv[1], "version") == 0) { + puts("linux " GOARCH " " SYZ_REVISION " " GIT_REVISION); + return 0; + } + prctl(PR_SET_PDEATHSIG, SIGKILL, 0, 0, 0); if (mmap(&input_data[0], kMaxInput, PROT_READ, MAP_PRIVATE | MAP_FIXED, kInFd, 0) != &input_data[0]) fail("mmap of input file failed"); diff --git a/executor/syscalls.h b/executor/syscalls.h index 68446e9a0..c530a1359 100644 --- a/executor/syscalls.h +++ b/executor/syscalls.h @@ -6,6 +6,8 @@ struct call_t { }; #if defined(__i386__) || 0 +#define GOARCH "386" +#define SYZ_REVISION "fb26afa29ccd7317f2c0796cf1386b493eeb955f" #define __NR_syz_emit_ethernet 1000000 #define __NR_syz_extract_tcp_res 1000001 #define __NR_syz_fuse_mount 1000002 @@ -1564,6 +1566,8 @@ static call_t syscalls[] = { #endif #if defined(__x86_64__) || 0 +#define GOARCH "amd64" +#define SYZ_REVISION "c14ec0f07c2984481a0bf1453ea928549382eb25" #define __NR_syz_emit_ethernet 1000000 #define __NR_syz_extract_tcp_res 1000001 #define __NR_syz_fuse_mount 1000002 @@ -3122,6 +3126,8 @@ static call_t syscalls[] = { #endif #if defined(__arm__) || 0 +#define GOARCH "arm" +#define SYZ_REVISION "f73cb445fdead3417b165eec037a0d892cc3253e" #define __NR_syz_emit_ethernet 1000000 #define __NR_syz_extract_tcp_res 1000001 #define __NR_syz_fuse_mount 1000002 @@ -4680,6 +4686,8 @@ static call_t syscalls[] = { #endif #if defined(__aarch64__) || 0 +#define GOARCH "arm64" +#define SYZ_REVISION "72353a7ede1fe6cb903fcb02eb5eb11407bea5d8" #define __NR_syz_emit_ethernet 1000000 #define __NR_syz_extract_tcp_res 1000001 #define __NR_syz_fuse_mount 1000002 @@ -6238,6 +6246,8 @@ static call_t syscalls[] = { #endif #if defined(__ppc64__) || defined(__PPC64__) || defined(__powerpc64__) || 0 +#define GOARCH "ppc64le" +#define SYZ_REVISION "cec4f3697757a69ac044be83bac5ba45df7f2fbf" #define __NR_syz_emit_ethernet 1000000 #define __NR_syz_extract_tcp_res 1000001 #define __NR_syz_fuse_mount 1000002 -- cgit mrf-deployment