From f5d46187023b23beff9797e8b461a9a041db3e9f Mon Sep 17 00:00:00 2001 From: Andrea Fioraldi Date: Fri, 31 Jan 2020 18:49:22 +0100 Subject: stop the fuzzer if AFL_QEMU_PERSISTENT_ADDR is wrong --- qemu_mode/patches/afl-qemu-cpu-inl.h | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'qemu_mode/patches/afl-qemu-cpu-inl.h') diff --git a/qemu_mode/patches/afl-qemu-cpu-inl.h b/qemu_mode/patches/afl-qemu-cpu-inl.h index ec8ce735..73be87ce 100644 --- a/qemu_mode/patches/afl-qemu-cpu-inl.h +++ b/qemu_mode/patches/afl-qemu-cpu-inl.h @@ -272,6 +272,8 @@ static void afl_forkserver(CPUState *cpu) { if (write(FORKSRV_FD + 1, tmp, 4) != 4) return; afl_forksrv_pid = getpid(); + + int first_run = 1; /* All right, let's await orders... */ @@ -349,6 +351,8 @@ static void afl_forkserver(CPUState *cpu) { again. */ if (WIFSTOPPED(status)) child_stopped = 1; + else if(unlikely(first_run)) exit(12); // Persistent is wrong + first_run = 0; if (write(FORKSRV_FD + 1, &status, 4) != 4) exit(7); -- cgit 1.4.1