Added AFL_UBSAN_VERBOSE variable

This commit is contained in:
Stepan Gulyaev
2024-11-21 16:37:24 +03:00
parent ebb919f771
commit 7aecf14c07
2 changed files with 14 additions and 7 deletions

View File

@ -114,10 +114,12 @@ static char *afl_environment_variables[] = {
"AFL_STATSD_TAGS_FLAVOR", "AFL_SYNC_TIME", "AFL_TESTCACHE_SIZE",
"AFL_TESTCACHE_ENTRIES", "AFL_TMIN_EXACT", "AFL_TMPDIR", "AFL_TOKEN_FILE",
"AFL_TRACE_PC", "AFL_USE_ASAN", "AFL_USE_MSAN", "AFL_USE_TRACE_PC",
"AFL_USE_UBSAN", "AFL_USE_TSAN", "AFL_USE_CFISAN", "AFL_CFISAN_VERBOSE",
"AFL_USE_LSAN", "AFL_WINE_PATH", "AFL_NO_SNAPSHOT", "AFL_EXPAND_HAVOC_NOW",
"AFL_USE_FASAN", "AFL_USE_QASAN", "AFL_PRINT_FILENAMES", "AFL_PIZZA_MODE",
"AFL_NO_FASTRESUME", NULL
"AFL_USE_UBSAN",
"AFL_UBSAN_VERBOSE"
"AFL_USE_TSAN",
"AFL_USE_CFISAN", "AFL_CFISAN_VERBOSE", "AFL_USE_LSAN", "AFL_WINE_PATH",
"AFL_NO_SNAPSHOT", "AFL_EXPAND_HAVOC_NOW", "AFL_USE_FASAN", "AFL_USE_QASAN",
"AFL_PRINT_FILENAMES", "AFL_PIZZA_MODE", "AFL_NO_FASTRESUME", NULL
};

View File

@ -1945,10 +1945,15 @@ void add_sanitizers(aflcc_state_t *aflcc, char **envp) {
if (getenv("AFL_USE_UBSAN") || aflcc->have_ubsan) {
if (!aflcc->have_ubsan) {
if (!aflcc->have_ubsan) { insert_param(aflcc, "-fsanitize=undefined"); }
insert_param(aflcc, "-fsanitize=undefined");
insert_param(aflcc, "-fno-sanitize-recover=all");
if (getenv("AFL_UBSAN_VERBOSE")) {
insert_param(aflcc, "-fno-sanitize-recover=undefined");
} else {
insert_param(aflcc, "-fsanitize-trap=undefined");
}