forked from aflgo/aflgo
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
13c63f8
commit 5144d64
Showing
19 changed files
with
313 additions
and
68 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,7 +4,7 @@ | |
# | ||
# Written and maintained by Michal Zalewski <[email protected]> | ||
# | ||
# Copyright 2013, 2014, 2015 Google Inc. All rights reserved. | ||
# Copyright 2013, 2014, 2015, 2016 Google Inc. All rights reserved. | ||
# | ||
# Licensed under the Apache License, Version 2.0 (the "License"); | ||
# you may not use this file except in compliance with the License. | ||
|
@@ -14,7 +14,7 @@ | |
# | ||
|
||
PROGNAME = afl | ||
VERSION = 2.02b | ||
VERSION = 2.03b | ||
|
||
PREFIX ?= /usr/local | ||
BIN_PATH = $(PREFIX)/bin | ||
|
@@ -46,18 +46,18 @@ COMM_HDR = alloc-inl.h config.h debug.h types.h | |
|
||
all: test_x86 $(PROGS) afl-as test_build all_done | ||
|
||
ifndef AFL_NOX86 | ||
ifndef AFL_NO_X86 | ||
|
||
test_x86: | ||
@echo "[*] Checking for the ability to compile x86 code..." | ||
@echo 'main() { __asm__("xorb %al, %al"); }' | $(CC) -w -x c - -o .test || ( echo; echo "Oops, looks like your compiler can't generate x86 code."; echo; echo "You can still try using the LLVM or QEMU mode, but see docs/INSTALL first."; echo "To ignore this error, set AFL_NOX86=1."; echo; exit 1 ) | ||
@echo 'main() { __asm__("xorb %al, %al"); }' | $(CC) -w -x c - -o .test || ( echo; echo "Oops, looks like your compiler can't generate x86 code."; echo; echo "You can still try using the LLVM or QEMU mode, but see docs/INSTALL first."; echo "To ignore this error, set AFL_NO_X86=1."; echo; exit 1 ) | ||
@rm -f .test | ||
@echo "[+] Everything seems to be working, ready to compile." | ||
|
||
else | ||
|
||
test_x86: | ||
@echo "[!] Note: skipping x86 compilation checks (AFL_NOX86 set)." | ||
@echo "[!] Note: skipping x86 compilation checks (AFL_NO_X86 set)." | ||
|
||
endif | ||
|
||
|
@@ -84,7 +84,7 @@ afl-analyze: afl-analyze.c $(COMM_HDR) | test_x86 | |
afl-gotcpu: afl-gotcpu.c $(COMM_HDR) | test_x86 | ||
$(CC) $(CFLAGS) $@.c -o $@ $(LDFLAGS) | ||
|
||
ifndef AFL_NOX86 | ||
ifndef AFL_NO_X86 | ||
|
||
test_build: afl-gcc afl-as afl-showmap | ||
@echo "[*] Testing the CC wrapper and instrumentation output..." | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,7 +6,7 @@ | |
Forkserver design by Jann Horn <[email protected]> | ||
Copyright 2013, 2014, 2015 Google Inc. All rights reserved. | ||
Copyright 2013, 2014, 2015, 2016 Google Inc. All rights reserved. | ||
Licensed under the Apache License, Version 2.0 (the "License"); | ||
you may not use this file except in compliance with the License. | ||
|
@@ -1934,12 +1934,14 @@ static void init_forkserver(char** argv) { | |
|
||
setenv("ASAN_OPTIONS", "abort_on_error=1:" | ||
"detect_leaks=0:" | ||
"symbolize=0:" | ||
"allocator_may_return_null=1", 0); | ||
|
||
/* MSAN is tricky, because it doesn't support abort_on_error=1 at this | ||
point. So, we do this in a very hacky way. */ | ||
|
||
setenv("MSAN_OPTIONS", "exit_code=" STRINGIFY(MSAN_ERROR) ":" | ||
"symbolize=0:" | ||
"msan_track_origins=0", 0); | ||
|
||
execv(target_path, argv); | ||
|
@@ -2197,9 +2199,11 @@ static u8 run_target(char** argv) { | |
|
||
setenv("ASAN_OPTIONS", "abort_on_error=1:" | ||
"detect_leaks=0:" | ||
"symbolize=0:" | ||
"allocator_may_return_null=1", 0); | ||
|
||
setenv("MSAN_OPTIONS", "exit_code=" STRINGIFY(MSAN_ERROR) ":" | ||
"symbolize=0:" | ||
"msan_track_origins=0", 0); | ||
|
||
execv(target_path, argv); | ||
|
@@ -7155,14 +7159,28 @@ static void handle_resize(int sig) { | |
static void check_asan_opts(void) { | ||
u8* x = getenv("ASAN_OPTIONS"); | ||
|
||
if (x && !strstr(x, "abort_on_error=1")) | ||
FATAL("Custom ASAN_OPTIONS set without abort_on_error=1 - please fix!"); | ||
if (x) { | ||
|
||
if (!strstr(x, "abort_on_error=1")) | ||
FATAL("Custom ASAN_OPTIONS set without abort_on_error=1 - please fix!"); | ||
|
||
if (!strstr(x, "symbolize=0")) | ||
FATAL("Custom ASAN_OPTIONS set without symbolize=0 - please fix!"); | ||
|
||
} | ||
|
||
x = getenv("MSAN_OPTIONS"); | ||
|
||
if (x && !strstr(x, "exit_code=" STRINGIFY(MSAN_ERROR))) | ||
FATAL("Custom MSAN_OPTIONS set without exit_code=" | ||
STRINGIFY(MSAN_ERROR) " - please fix!"); | ||
if (x) { | ||
|
||
if (!strstr(x, "exit_code=" STRINGIFY(MSAN_ERROR))) | ||
FATAL("Custom MSAN_OPTIONS set without exit_code=" | ||
STRINGIFY(MSAN_ERROR) " - please fix!"); | ||
|
||
if (!strstr(x, "symbolize=0")) | ||
FATAL("Custom MSAN_OPTIONS set without symbolize=0 - please fix!"); | ||
|
||
} | ||
|
||
} | ||
|
||
|
@@ -7365,6 +7383,7 @@ int main(int argc, char** argv) { | |
u32 sync_interval_cnt = 0, seek_to; | ||
u8 *extras_dir = 0; | ||
u8 mem_limit_given = 0; | ||
u8 exit_1 = !!getenv("AFL_BENCH_JUST_ONE"); | ||
|
||
char** use_argv; | ||
|
||
|
@@ -7553,6 +7572,9 @@ int main(int argc, char** argv) { | |
if (dumb_mode == 2 && no_forkserver) | ||
FATAL("AFL_DUMB_FORKSRV and AFL_NO_FORKSRV are mutually exclusive"); | ||
|
||
if (getenv("AFL_LD_PRELOAD")) | ||
setenv("LD_PRELOAD", getenv("AFL_LD_PRELOAD"), 1); | ||
|
||
save_cmdline(argc, argv); | ||
|
||
fix_up_banner(argv[optind]); | ||
|
@@ -7661,6 +7683,8 @@ int main(int argc, char** argv) { | |
|
||
} | ||
|
||
if (!stop_soon && exit_1) stop_soon = 2; | ||
|
||
if (stop_soon) break; | ||
|
||
queue_cur = queue_cur->next; | ||
|
@@ -7676,8 +7700,8 @@ int main(int argc, char** argv) { | |
|
||
stop_fuzzing: | ||
|
||
SAYF(CURSOR_SHOW cLRD "\n\n+++ Testing %s +++\n" cRST, | ||
stop_soon == 2 ? "ended via AFL_EXIT_WHEN_DONE" : "aborted by user"); | ||
SAYF(CURSOR_SHOW cLRD "\n\n+++ Testing aborted %s +++\n" cRST, | ||
stop_soon == 2 ? "programatically" : "by user"); | ||
|
||
/* Running for more than 30 minutes but still doing first cycle? */ | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,7 +4,7 @@ | |
Written and maintained by Michal Zalewski <[email protected]> | ||
Copyright 2013, 2014, 2015 Google Inc. All rights reserved. | ||
Copyright 2013, 2014, 2015, 2016 Google Inc. All rights reserved. | ||
Licensed under the Apache License, Version 2.0 (the "License"); | ||
you may not use this file except in compliance with the License. | ||
|
@@ -332,11 +332,16 @@ static void set_up_environment(void) { | |
|
||
setenv("ASAN_OPTIONS", "abort_on_error=1:" | ||
"detect_leaks=0:" | ||
"symbolize=0:" | ||
"allocator_may_return_null=1", 0); | ||
|
||
setenv("MSAN_OPTIONS", "exit_code=" STRINGIFY(MSAN_ERROR) ":" | ||
"symbolize=0:" | ||
"msan_track_origins=0", 0); | ||
|
||
if (getenv("AFL_LD_PRELOAD")) | ||
setenv("LD_PRELOAD", getenv("AFL_LD_PRELOAD"), 1); | ||
|
||
} | ||
|
||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,7 +4,7 @@ | |
Written and maintained by Michal Zalewski <[email protected]> | ||
Copyright 2015 Google Inc. All rights reserved. | ||
Copyright 2015, 2016 Google Inc. All rights reserved. | ||
Licensed under the Apache License, Version 2.0 (the "License"); | ||
you may not use this file except in compliance with the License. | ||
|
@@ -668,22 +668,41 @@ static void set_up_environment(void) { | |
|
||
x = getenv("ASAN_OPTIONS"); | ||
|
||
if (x && !strstr(x, "abort_on_error=1")) | ||
FATAL("Custom ASAN_OPTIONS set without abort_on_error=1 - please fix!"); | ||
if (x) { | ||
|
||
if (!strstr(x, "abort_on_error=1")) | ||
FATAL("Custom ASAN_OPTIONS set without abort_on_error=1 - please fix!"); | ||
|
||
if (!strstr(x, "symbolize=0")) | ||
FATAL("Custom ASAN_OPTIONS set without symbolize=0 - please fix!"); | ||
|
||
} | ||
|
||
x = getenv("MSAN_OPTIONS"); | ||
|
||
if (x && !strstr(x, "exit_code=" STRINGIFY(MSAN_ERROR))) | ||
FATAL("Custom MSAN_OPTIONS set without exit_code=" | ||
STRINGIFY(MSAN_ERROR) " - please fix!"); | ||
if (x) { | ||
|
||
if (!strstr(x, "exit_code=" STRINGIFY(MSAN_ERROR))) | ||
FATAL("Custom MSAN_OPTIONS set without exit_code=" | ||
STRINGIFY(MSAN_ERROR) " - please fix!"); | ||
|
||
if (!strstr(x, "symbolize=0")) | ||
FATAL("Custom MSAN_OPTIONS set without symbolize=0 - please fix!"); | ||
|
||
} | ||
|
||
setenv("ASAN_OPTIONS", "abort_on_error=1:" | ||
"detect_leaks=0:" | ||
"symbolize=0:" | ||
"allocator_may_return_null=1", 0); | ||
|
||
setenv("MSAN_OPTIONS", "exit_code=" STRINGIFY(MSAN_ERROR) ":" | ||
"symbolize=0:" | ||
"msan_track_origins=0", 0); | ||
|
||
if (getenv("AFL_LD_PRELOAD")) | ||
setenv("LD_PRELOAD", getenv("AFL_LD_PRELOAD"), 1); | ||
|
||
} | ||
|
||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,7 +4,7 @@ | |
Written and maintained by Michal Zalewski <[email protected]> | ||
Copyright 2013, 2014, 2015 Google Inc. All rights reserved. | ||
Copyright 2013, 2014, 2015, 2016 Google Inc. All rights reserved. | ||
Licensed under the Apache License, Version 2.0 (the "License"); | ||
you may not use this file except in compliance with the License. | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,7 +4,7 @@ | |
Written and maintained by Michal Zalewski <[email protected]> | ||
Copyright 2013, 2014, 2015 Google Inc. All rights reserved. | ||
Copyright 2013, 2014, 2015, 2016 Google Inc. All rights reserved. | ||
Licensed under the Apache License, Version 2.0 (the "License"); | ||
you may not use this file except in compliance with the License. | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -13,9 +13,33 @@ Want to stay in the loop on major new features? Join our mailing list by | |
sending a mail to <[email protected]>. | ||
|
||
Not sure if you should upgrade? The lowest currently recommended version | ||
is 1.92b. If you're stuck on an earlier release, it's strongly advisable | ||
is 2.03b. If you're stuck on an earlier release, it's strongly advisable | ||
to get on with the times. | ||
|
||
-------------- | ||
Version 2.03b: | ||
-------------- | ||
|
||
- Added experimental -fsanitize-coverage=trace-pc support that goes with | ||
some recent additions to LLVM, as implemented by Kostya Serebryany. | ||
Right now, this is cumbersome to use with common build systems, so | ||
the mode remains undocumented. | ||
|
||
- Made several substantial improvements to better support non-standard | ||
map sizes in LLVM mode. | ||
|
||
- Switched LLVM mode to thread-local execution tracing, which may offer | ||
better results in some multithreaded apps. | ||
|
||
- Fixed a minor typo, reported by Heiko Eissfeldt. | ||
|
||
- Force-disabled symbolization for ASAN, as suggested by Christian Holler. | ||
|
||
- AFL_NOX86 renamed to AFL_NO_X86 for consistency. | ||
|
||
- Added AFL_LD_PRELOAD to allow LD_PRELOAD to be set for targets without | ||
affecting AFL itself. Suggested by Daniel Godas-Lopez. | ||
|
||
-------------- | ||
Version 2.02b: | ||
-------------- | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.