aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorhexcoder- <heiko@hexco.de>2020-02-13 21:06:09 +0100
committerhexcoder- <heiko@hexco.de>2020-02-13 21:06:09 +0100
commit24dcc5eb37dcb3c657ceef5fa33b48b1237342f5 (patch)
tree859f35aa7dca7c516d88873f9fec162d7162ea16 /src
parentafb23f09cf921d54ef9d11d5fa2a219f824ee025 (diff)
downloadafl++-24dcc5eb37dcb3c657ceef5fa33b48b1237342f5.tar.gz
fix issue #194 more seriously
Diffstat (limited to 'src')
-rw-r--r--src/afl-as.c23
-rw-r--r--src/afl-gcc.c12
2 files changed, 31 insertions, 4 deletions
diff --git a/src/afl-as.c b/src/afl-as.c
index 5fa83569..12192838 100644
--- a/src/afl-as.c
+++ b/src/afl-as.c
@@ -478,13 +478,28 @@ static void add_instrumentation(void) {
if (!ins_lines)
WARNF("No instrumentation targets found%s.",
pass_thru ? " (pass-thru mode)" : "");
- else
+ else {
+ char modeline[100];
+ snprintf(modeline, sizeof(modeline), "%s%s%s%s",
+ getenv("AFL_HARDEN")
+ ? "hardened"
+ : "non-hardened",
+ getenv("AFL_USE_ASAN")
+ ? ", ASAN"
+ : "",
+ getenv("AFL_USE_MSAN")
+ ? ", MSAN"
+ : "",
+ getenv("AFL_USE_UBSAN")
+ ? ", UBSAN"
+ : ""
+ );
+
OKF("Instrumented %u locations (%s-bit, %s mode, ratio %u%%).", ins_lines,
use_64bit ? "64" : "32",
- getenv("AFL_HARDEN") ? "hardened"
- : (sanitizer ? "ASAN/MSAN" : "non-hardened"),
+ modeline,
inst_ratio);
-
+ }
}
}
diff --git a/src/afl-gcc.c b/src/afl-gcc.c
index e46fe5cd..5ead32fb 100644
--- a/src/afl-gcc.c
+++ b/src/afl-gcc.c
@@ -282,6 +282,18 @@ static void edit_params(u32 argc, char** argv) {
}
+ if (!asan_set) {
+
+ if (getenv("AFL_USE_UBSAN")) {
+
+ cc_params[cc_par_cnt++] = "-fsanitize=undefined";
+ cc_params[cc_par_cnt++] = "-fsanitize-undefined-trap-on-error";
+ cc_params[cc_par_cnt++] = "-fno-sanitize-recover=all";
+
+ }
+
+ }
+
#ifdef USEMMAP
cc_params[cc_par_cnt++] = "-lrt";
#endif