From bca7ce804308fdc24404d26a02d2e10116ef6289 Mon Sep 17 00:00:00 2001 From: van Hauser Date: Mon, 1 Jun 2020 12:30:20 +0200 Subject: fixed persistent mode shared mem fuzzing --- examples/persistent_demo/Makefile | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'examples/persistent_demo/Makefile') diff --git a/examples/persistent_demo/Makefile b/examples/persistent_demo/Makefile index cbbb7239..ea8fd02a 100644 --- a/examples/persistent_demo/Makefile +++ b/examples/persistent_demo/Makefile @@ -1,6 +1,10 @@ all: afl-clang-fast -o persistent_demo persistent_demo.c afl-clang-fast -o persistent_demo_new persistent_demo_new.c + afl-clang-fast -o test-instr test-instr.c + +document: + afl-clang-fast -D_AFL_DOCUMENT_MUTATIONS -o test-instr test-instr.c clean: - rm -f persistent_demo persistent_demo_new + rm -f persistent_demo persistent_demo_new test-instr -- cgit 1.4.1 From 15c0ad60c530906131fc089d8f5b05710c69f109 Mon Sep 17 00:00:00 2001 From: van Hauser Date: Mon, 1 Jun 2020 13:15:16 +0200 Subject: minimal changes to a test --- examples/persistent_demo/Makefile | 2 +- examples/persistent_demo/test-instr.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) (limited to 'examples/persistent_demo/Makefile') diff --git a/examples/persistent_demo/Makefile b/examples/persistent_demo/Makefile index ea8fd02a..e2cf97f5 100644 --- a/examples/persistent_demo/Makefile +++ b/examples/persistent_demo/Makefile @@ -4,7 +4,7 @@ all: afl-clang-fast -o test-instr test-instr.c document: - afl-clang-fast -D_AFL_DOCUMENT_MUTATIONS -o test-instr test-instr.c + AFL_DONT_OPTIMIZE=1 afl-clang-fast -D_AFL_DOCUMENT_MUTATIONS -o test-instr test-instr.c clean: rm -f persistent_demo persistent_demo_new test-instr diff --git a/examples/persistent_demo/test-instr.c b/examples/persistent_demo/test-instr.c index cd1c9b0e..4cd07102 100644 --- a/examples/persistent_demo/test-instr.c +++ b/examples/persistent_demo/test-instr.c @@ -36,7 +36,7 @@ int main(int argc, char **argv) { int fd_doc = open(fn, O_WRONLY | O_CREAT | O_TRUNC, 0600); if (fd_doc >= 0) { - if (write(fd_doc, __afl_fuzz_ptr, __afl_fuzz_len) != __afl_fuzz_len) { + if (write(fd_doc, buf, len) != __afl_fuzz_len) { fprintf(stderr, "write of mutation file failed: %s\n", fn); unlink(fn); -- cgit 1.4.1 From ac998e9222c5a7572716cd2ec1affd00d7a45e3d Mon Sep 17 00:00:00 2001 From: van Hauser Date: Mon, 1 Jun 2020 13:15:34 +0200 Subject: minimal changes to a test --- examples/persistent_demo/Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'examples/persistent_demo/Makefile') diff --git a/examples/persistent_demo/Makefile b/examples/persistent_demo/Makefile index e2cf97f5..6fa1c30e 100644 --- a/examples/persistent_demo/Makefile +++ b/examples/persistent_demo/Makefile @@ -1,7 +1,7 @@ all: afl-clang-fast -o persistent_demo persistent_demo.c afl-clang-fast -o persistent_demo_new persistent_demo_new.c - afl-clang-fast -o test-instr test-instr.c + AFL_DONT_OPTIMIZE=1 afl-clang-fast -o test-instr test-instr.c document: AFL_DONT_OPTIMIZE=1 afl-clang-fast -D_AFL_DOCUMENT_MUTATIONS -o test-instr test-instr.c -- cgit 1.4.1