fix IGNORE_PROBLEMS and update qemuafl

This commit is contained in:
vanhauser-thc
2023-03-06 09:59:52 +01:00
parent cb8296bdb0
commit e6a05382b8
6 changed files with 44 additions and 31 deletions

View File

@ -11,6 +11,8 @@
- add CFI sanitizer variant to gcc targets
- llvm 16 support (thanks to @devnexen!)
- support llvm 15 native pcguard changes
- qemu_mode:
- fix _RANGES envs to allow hyphens in the filenames
- new custom module: autotoken, grammar free fuzzer for text inputs
- LTO autoken and llvm_mode: added AFL_LLVM_DICT2FILE_NO_MAIN support
- better sanitizer default options support for all tools

View File

@ -1539,12 +1539,16 @@ void __sanitizer_cov_trace_pc_guard_init(uint32_t *start, uint32_t *stop) {
if (start == stop || *start) return;
x = getenv("AFL_INST_RATIO");
if (x) { inst_ratio = (u32)atoi(x); }
if (x) {
if (!inst_ratio || inst_ratio > 100) {
inst_ratio = (u32)atoi(x);
fprintf(stderr, "[-] ERROR: Invalid AFL_INST_RATIO (must be 1-100).\n");
abort();
if (!inst_ratio || inst_ratio > 100) {
fprintf(stderr, "[-] ERROR: Invalid AFL_INST_RATIO (must be 1-100).\n");
abort();
}
}
@ -1568,10 +1572,16 @@ void __sanitizer_cov_trace_pc_guard_init(uint32_t *start, uint32_t *stop) {
while (start < stop) {
if (likely(inst_ratio == 100) || R(100) < inst_ratio)
*start = offset;
else
*start = 0; // write to map[0]
if (likely(inst_ratio == 100) || R(100) < inst_ratio) {
*(start++) = offset;
} else {
*(start++) = 0; // write to map[0]
}
if (unlikely(++offset >= __afl_final_loc)) { offset = 4; }
}
@ -1592,12 +1602,15 @@ void __sanitizer_cov_trace_pc_guard_init(uint32_t *start, uint32_t *stop) {
while (start < stop) {
if (likely(inst_ratio == 100) || R(100) < inst_ratio)
*start = ++__afl_final_loc;
else
*start = 0; // write to map[0]
if (likely(inst_ratio == 100) || R(100) < inst_ratio) {
start++;
*(start++) = ++__afl_final_loc;
} else {
*(start++) = 0; // write to map[0]
}
}

View File

@ -37,10 +37,10 @@ typedef long double max_align_t;
#define MNAME M.getSourceFileName()
#define FMNAME F.getParent()->getSourceFileName()
#if LLVM_VERSION_MAJOR >= 16
// None becomes deprecated
// the standard std::nullopt_t is recommended instead
// from C++17 and onwards.
constexpr std::nullopt_t None = std::nullopt;
// None becomes deprecated
// the standard std::nullopt_t is recommended instead
// from C++17 and onwards.
constexpr std::nullopt_t None = std::nullopt;
#endif
#else
#define MNAME std::string("")

View File

@ -1 +1 @@
a8af9cbde7
74c583b11a

View File

@ -672,12 +672,11 @@ void show_stats_normal(afl_state_t *afl) {
/* If no coverage was found yet, check whether run time is greater than
* exit_on_time. */
if (unlikely(
!afl->non_instrumented_mode && afl->afl_env.afl_exit_on_time &&
((afl->last_find_time &&
(cur_ms - afl->last_find_time) > afl->exit_on_time) ||
(!afl->last_find_time && (cur_ms - afl->start_time)
> afl->exit_on_time)))) {
if (unlikely(!afl->non_instrumented_mode && afl->afl_env.afl_exit_on_time &&
((afl->last_find_time &&
(cur_ms - afl->last_find_time) > afl->exit_on_time) ||
(!afl->last_find_time &&
(cur_ms - afl->start_time) > afl->exit_on_time)))) {
afl->stop_soon = 2;
@ -1476,12 +1475,11 @@ void show_stats_pizza(afl_state_t *afl) {
/* If no coverage was found yet, check whether run time is greater than
* exit_on_time. */
if (unlikely(
!afl->non_instrumented_mode && afl->afl_env.afl_exit_on_time &&
((afl->last_find_time &&
(cur_ms - afl->last_find_time) > afl->exit_on_time) ||
(!afl->last_find_time && (cur_ms - afl->start_time)
> afl->exit_on_time)))) {
if (unlikely(!afl->non_instrumented_mode && afl->afl_env.afl_exit_on_time &&
((afl->last_find_time &&
(cur_ms - afl->last_find_time) > afl->exit_on_time) ||
(!afl->last_find_time &&
(cur_ms - afl->start_time) > afl->exit_on_time)))) {
afl->stop_soon = 2;