Merge pull request #2071 from AFLplusplus/dev

Push to stable
This commit is contained in:
van Hauser 2024-04-26 16:17:41 +02:00 committed by GitHub
commit ad0d0c77fb
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
41 changed files with 158 additions and 62 deletions

View File

@ -5,7 +5,6 @@ on:
branches: branches:
- stable - stable
- dev - dev
- 420
pull_request: pull_request:
branches: branches:
- dev # No need for stable-pull-request, as that equals dev-push - dev # No need for stable-pull-request, as that equals dev-push

View File

@ -4,7 +4,7 @@
Release version: [4.20c](https://github.com/AFLplusplus/AFLplusplus/releases) Release version: [4.20c](https://github.com/AFLplusplus/AFLplusplus/releases)
GitHub version: 4.20c GitHub version: 4.21a
Repository: Repository:
[https://github.com/AFLplusplus/AFLplusplus](https://github.com/AFLplusplus/AFLplusplus) [https://github.com/AFLplusplus/AFLplusplus](https://github.com/AFLplusplus/AFLplusplus)

View File

@ -13,7 +13,7 @@ awk -f - -- ${@+"$@"} <<'EOF'
# awk script to minimize a test corpus of input files # awk script to minimize a test corpus of input files
# #
# based on afl-cmin bash script written by Michal Zalewski # based on afl-cmin bash script written by Michal Zalewski
# rewritten by Heiko Eißfeldt (hexcoder-) # rewritten by Heiko Eissfeldt (hexcoder-)
# tested with: # tested with:
# gnu awk (x86 Linux) # gnu awk (x86 Linux)
# bsd awk (x86 *BSD) # bsd awk (x86 *BSD)
@ -603,8 +603,8 @@ BEGIN {
# create path for the trace file from afl-showmap # create path for the trace file from afl-showmap
tracefile_path = trace_dir"/"fn tracefile_path = trace_dir"/"fn
# ensure the file size is not zero # ensure the file size is not zero
cmd = "du -b "tracefile_path cmd = "du -b \""tracefile_path"\""
"ls -l "tracefile_path # "ls -l \""tracefile_path"\""
cmd | getline output cmd | getline output
close(cmd) close(cmd)
split(output, result, "\t") split(output, result, "\t")

View File

@ -152,6 +152,7 @@ Minimization settings:
-e - solve for edge coverage only, ignore hit counts -e - solve for edge coverage only, ignore hit counts
For additional tips, please consult README.md. For additional tips, please consult README.md.
This script cannot read filenames that end with a space ' '.
Environment variables used: Environment variables used:
AFL_KEEP_TRACES: leave the temporary <out_dir>\.traces directory AFL_KEEP_TRACES: leave the temporary <out_dir>\.traces directory

View File

@ -3,6 +3,18 @@
This is the list of all noteworthy changes made in every public This is the list of all noteworthy changes made in every public
release of the tool. See README.md for the general instruction manual. release of the tool. See README.md for the general instruction manual.
### Version ++4.21a (dev)
* afl-fuzz
- fix AFL_PERSISTENT_RECORD
- prevent filenames in the queue that have spaces
- minor fix for FAST schedules
* afl-cc:
- fixes for LTO and outdated afl-gcc mode
- ensure shared memory variables are visible in weird build setups
* afl-cmin
- work with input files that have a space
### Version ++4.20c (release) ### Version ++4.20c (release)
! A new forkserver communication model is now introduced. afl-fuzz is ! A new forkserver communication model is now introduced. afl-fuzz is
backward compatible to old compiled targets if they are not built backward compatible to old compiled targets if they are not built

View File

@ -5,7 +5,7 @@
Originally written by Michal Zalewski Originally written by Michal Zalewski
Now maintained by Marc Heuse <mh@mh-sec.de>, Now maintained by Marc Heuse <mh@mh-sec.de>,
Heiko Eißfeldt <heiko.eissfeldt@hexco.de>, Heiko Eissfeldt <heiko.eissfeldt@hexco.de>,
Andrea Fioraldi <andreafioraldi@gmail.com>, Andrea Fioraldi <andreafioraldi@gmail.com>,
Dominik Maier <mail@dmnk.co> Dominik Maier <mail@dmnk.co>

View File

@ -5,7 +5,7 @@
Originally written by Michal Zalewski Originally written by Michal Zalewski
Now maintained by Marc Heuse <mh@mh-sec.de>, Now maintained by Marc Heuse <mh@mh-sec.de>,
Heiko Eißfeldt <heiko.eissfeldt@hexco.de>, Heiko Eissfeldt <heiko.eissfeldt@hexco.de>,
Andrea Fioraldi <andreafioraldi@gmail.com>, Andrea Fioraldi <andreafioraldi@gmail.com>,
Dominik Maier <mail@dmnk.co> Dominik Maier <mail@dmnk.co>

View File

@ -5,7 +5,7 @@
Originally written by Michal Zalewski Originally written by Michal Zalewski
Now maintained by Marc Heuse <mh@mh-sec.de>, Now maintained by Marc Heuse <mh@mh-sec.de>,
Heiko Eißfeldt <heiko.eissfeldt@hexco.de>, Heiko Eissfeldt <heiko.eissfeldt@hexco.de>,
Andrea Fioraldi <andreafioraldi@gmail.com>, Andrea Fioraldi <andreafioraldi@gmail.com>,
Dominik Maier <mail@dmnk.co> Dominik Maier <mail@dmnk.co>

View File

@ -7,7 +7,7 @@
Forkserver design by Jann Horn <jannhorn@googlemail.com> Forkserver design by Jann Horn <jannhorn@googlemail.com>
Now maintained by Marc Heuse <mh@mh-sec.de>, Now maintained by Marc Heuse <mh@mh-sec.de>,
Heiko Eißfeldt <heiko.eissfeldt@hexco.de>, Heiko Eissfeldt <heiko.eissfeldt@hexco.de>,
Andrea Fioraldi <andreafioraldi@gmail.com>, Andrea Fioraldi <andreafioraldi@gmail.com>,
Dominik Maier <mail@dmnk.co> Dominik Maier <mail@dmnk.co>

View File

@ -5,7 +5,7 @@
Originally written by Michal Zalewski Originally written by Michal Zalewski
Now maintained by Marc Heuse <mh@mh-sec.de>, Now maintained by Marc Heuse <mh@mh-sec.de>,
Heiko Eißfeldt <heiko.eissfeldt@hexco.de>, Heiko Eissfeldt <heiko.eissfeldt@hexco.de>,
Andrea Fioraldi <andreafioraldi@gmail.com>, Andrea Fioraldi <andreafioraldi@gmail.com>,
Dominik Maier <mail@dmnk.co> Dominik Maier <mail@dmnk.co>

View File

@ -26,7 +26,7 @@
/* Version string: */ /* Version string: */
// c = release, a = volatile github dev, e = experimental branch // c = release, a = volatile github dev, e = experimental branch
#define VERSION "++4.20c" #define VERSION "++4.21a"
/****************************************************** /******************************************************
* * * *

View File

@ -5,7 +5,7 @@
Originally written by Michal Zalewski Originally written by Michal Zalewski
Now maintained by Marc Heuse <mh@mh-sec.de>, Now maintained by Marc Heuse <mh@mh-sec.de>,
Heiko Eißfeldt <heiko.eissfeldt@hexco.de>, Heiko Eissfeldt <heiko.eissfeldt@hexco.de>,
Andrea Fioraldi <andreafioraldi@gmail.com>, Andrea Fioraldi <andreafioraldi@gmail.com>,
Dominik Maier <mail@dmnk.co> Dominik Maier <mail@dmnk.co>

View File

@ -7,7 +7,7 @@
Forkserver design by Jann Horn <jannhorn@googlemail.com> Forkserver design by Jann Horn <jannhorn@googlemail.com>
Now maintained by Marc Heuse <mh@mh-sec.de>, Now maintained by Marc Heuse <mh@mh-sec.de>,
Heiko Eißfeldt <heiko.eissfeldt@hexco.de>, Heiko Eissfeldt <heiko.eissfeldt@hexco.de>,
Andrea Fioraldi <andreafioraldi@gmail.com>, Andrea Fioraldi <andreafioraldi@gmail.com>,
Dominik Maier <mail@dmnk.co>> Dominik Maier <mail@dmnk.co>>

View File

@ -5,7 +5,7 @@
Originally written by Michal Zalewski Originally written by Michal Zalewski
Now maintained by Marc Heuse <mh@mh-sec.de>, Now maintained by Marc Heuse <mh@mh-sec.de>,
Heiko Eißfeldt <heiko.eissfeldt@hexco.de>, Heiko Eissfeldt <heiko.eissfeldt@hexco.de>,
Andrea Fioraldi <andreafioraldi@gmail.com>, Andrea Fioraldi <andreafioraldi@gmail.com>,
Dominik Maier <mail@dmnk.co> Dominik Maier <mail@dmnk.co>

View File

@ -7,7 +7,7 @@
Forkserver design by Jann Horn <jannhorn@googlemail.com> Forkserver design by Jann Horn <jannhorn@googlemail.com>
Now maintained by Marc Heuse <mh@mh-sec.de>, Now maintained by Marc Heuse <mh@mh-sec.de>,
Heiko Eißfeldt <heiko.eissfeldt@hexco.de>, Heiko Eissfeldt <heiko.eissfeldt@hexco.de>,
Andrea Fioraldi <andreafioraldi@gmail.com>, Andrea Fioraldi <andreafioraldi@gmail.com>,
Dominik Maier <mail@dmnk.co> Dominik Maier <mail@dmnk.co>

View File

@ -7,7 +7,7 @@
Forkserver design by Jann Horn <jannhorn@googlemail.com> Forkserver design by Jann Horn <jannhorn@googlemail.com>
Now maintained by Marc Heuse <mh@mh-sec.de>, Now maintained by Marc Heuse <mh@mh-sec.de>,
Heiko Eißfeldt <heiko.eissfeldt@hexco.de>, Heiko Eissfeldt <heiko.eissfeldt@hexco.de>,
Andrea Fioraldi <andreafioraldi@gmail.com>, Andrea Fioraldi <andreafioraldi@gmail.com>,
Dominik Maier <mail@dmnk.co> Dominik Maier <mail@dmnk.co>

View File

@ -5,7 +5,7 @@
Originally written by Michal Zalewski Originally written by Michal Zalewski
Now maintained by Marc Heuse <mh@mh-sec.de>, Now maintained by Marc Heuse <mh@mh-sec.de>,
Heiko Eißfeldt <heiko.eissfeldt@hexco.de>, Heiko Eissfeldt <heiko.eissfeldt@hexco.de>,
Andrea Fioraldi <andreafioraldi@gmail.com>, Andrea Fioraldi <andreafioraldi@gmail.com>,
Dominik Maier <mail@dmnk.co> Dominik Maier <mail@dmnk.co>

View File

@ -341,7 +341,7 @@ llvmGetPassPluginInfo() {
using OptimizationLevel = typename PassBuilder::OptimizationLevel; using OptimizationLevel = typename PassBuilder::OptimizationLevel;
#endif #endif
#if LLVM_VERSION_MAJOR >= 15 #if LLVM_VERSION_MAJOR >= 15
PB.registerFullLinkTimeOptimizationEarlyEPCallback( PB.registerFullLinkTimeOptimizationLastEPCallback(
#else #else
PB.registerOptimizerLastEPCallback( PB.registerOptimizerLastEPCallback(
#endif #endif

View File

@ -1,7 +1,7 @@
/* /*
* Copyright 2016 laf-intel * Copyright 2016 laf-intel
* extended for floating point by Heiko Eißfeldt * extended for floating point by Heiko Eissfeldt
* adapted to new pass manager by Heiko Eißfeldt * adapted to new pass manager by Heiko Eissfeldt
* *
* Licensed under the Apache License, Version 2.0 (the "License"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.

View File

@ -5,7 +5,7 @@
Originally written by Michal Zalewski Originally written by Michal Zalewski
Now maintained by Marc Heuse <mh@mh-sec.de>, Now maintained by Marc Heuse <mh@mh-sec.de>,
Heiko Eißfeldt <heiko.eissfeldt@hexco.de> and Heiko Eissfeldt <heiko.eissfeldt@hexco.de> and
Andrea Fioraldi <andreafioraldi@gmail.com> Andrea Fioraldi <andreafioraldi@gmail.com>
Copyright 2016, 2017 Google Inc. All rights reserved. Copyright 2016, 2017 Google Inc. All rights reserved.

View File

@ -5,7 +5,7 @@
Originally written by Michal Zalewski Originally written by Michal Zalewski
Now maintained by Marc Heuse <mh@mh-sec.de>, Now maintained by Marc Heuse <mh@mh-sec.de>,
Heiko Eißfeldt <heiko.eissfeldt@hexco.de> and Heiko Eissfeldt <heiko.eissfeldt@hexco.de> and
Andrea Fioraldi <andreafioraldi@gmail.com> Andrea Fioraldi <andreafioraldi@gmail.com>
Copyright 2016, 2017 Google Inc. All rights reserved. Copyright 2016, 2017 Google Inc. All rights reserved.

View File

@ -17,6 +17,10 @@
#define AFL_MAIN #define AFL_MAIN
#ifndef _GNU_SOURCE
#define _GNU_SOURCE 1
#endif
#include "common.h" #include "common.h"
#include "config.h" #include "config.h"
#include "types.h" #include "types.h"
@ -32,7 +36,9 @@
#include <limits.h> #include <limits.h>
#include <assert.h> #include <assert.h>
#include <ctype.h> #include <ctype.h>
#include <fcntl.h>
#include <sys/stat.h> #include <sys/stat.h>
#include <sys/mman.h>
#if (LLVM_MAJOR - 0 == 0) #if (LLVM_MAJOR - 0 == 0)
#undef LLVM_MAJOR #undef LLVM_MAJOR
@ -464,6 +470,8 @@ u8 *find_object(aflcc_state_t *aflcc, u8 *obj) {
*slash = 0; *slash = 0;
tmp = alloc_printf("%s/%s", exepath, obj); tmp = alloc_printf("%s/%s", exepath, obj);
if (aflcc->debug) DEBUGF("Trying %s\n", tmp);
if (!access(tmp, R_OK)) { return tmp; } if (!access(tmp, R_OK)) { return tmp; }
ck_free(tmp); ck_free(tmp);
@ -518,7 +526,7 @@ void find_built_deps(aflcc_state_t *aflcc) {
char *ptr = NULL; char *ptr = NULL;
#if defined(__x86_64__) #if defined(__x86_64__)
if ((ptr = find_object(aflcc, "as")) != NULL) { if ((ptr = find_object(aflcc, "afl-as")) != NULL) {
#ifndef __APPLE__ #ifndef __APPLE__
// on OSX clang masquerades as GCC // on OSX clang masquerades as GCC
@ -1261,13 +1269,8 @@ void mode_final_checkout(aflcc_state_t *aflcc, int argc, char **argv) {
aflcc->instrument_mode == INSTRUMENT_PCGUARD) { aflcc->instrument_mode == INSTRUMENT_PCGUARD) {
aflcc->lto_mode = 1; aflcc->lto_mode = 1;
// force CFG
// if (!aflcc->instrument_mode) {
aflcc->instrument_mode = INSTRUMENT_PCGUARD; aflcc->instrument_mode = INSTRUMENT_PCGUARD;
// }
} else if (aflcc->instrument_mode == INSTRUMENT_CLASSIC) { } else if (aflcc->instrument_mode == INSTRUMENT_CLASSIC) {
aflcc->lto_mode = 1; aflcc->lto_mode = 1;
@ -1583,8 +1586,10 @@ void add_defs_persistent_mode(aflcc_state_t *aflcc) {
insert_param(aflcc, insert_param(aflcc,
"-D__AFL_FUZZ_INIT()=" "-D__AFL_FUZZ_INIT()="
"int __afl_sharedmem_fuzzing = 1;" "int __afl_sharedmem_fuzzing = 1;"
"extern unsigned int *__afl_fuzz_len;" "extern __attribute__((visibility(\"default\"))) "
"extern unsigned char *__afl_fuzz_ptr;" "unsigned int *__afl_fuzz_len;"
"extern __attribute__((visibility(\"default\"))) "
"unsigned char *__afl_fuzz_ptr;"
"unsigned char __afl_fuzz_alt[1048576];" "unsigned char __afl_fuzz_alt[1048576];"
"unsigned char *__afl_fuzz_alt_ptr = __afl_fuzz_alt;"); "unsigned char *__afl_fuzz_alt_ptr = __afl_fuzz_alt;");
@ -2473,13 +2478,60 @@ void add_runtime(aflcc_state_t *aflcc) {
*/ */
void add_assembler(aflcc_state_t *aflcc) { void add_assembler(aflcc_state_t *aflcc) {
u8 *afl_as = find_object(aflcc, "as"); u8 *afl_as = find_object(aflcc, "afl-as");
if (!afl_as) FATAL("Cannot find 'as' (symlink to 'afl-as')."); if (!afl_as) FATAL("Cannot find 'afl-as'.");
u8 *slash = strrchr(afl_as, '/'); u8 *slash = strrchr(afl_as, '/');
if (slash) *slash = 0; if (slash) *slash = 0;
// Search for 'as' may be unreliable in some cases (see #2058)
// so use 'afl-as' instead, because 'as' is usually a symbolic link,
// or can be a renamed copy of 'afl-as' created in the same dir.
// Now we should verify if the compiler can find the 'as' we need.
#define AFL_AS_ERR "(should be a symlink or copy of 'afl-as')"
u8 *afl_as_dup = alloc_printf("%s/as", afl_as);
int fd = open(afl_as_dup, O_RDONLY);
if (fd < 0) { PFATAL("Unable to open '%s' " AFL_AS_ERR, afl_as_dup); }
struct stat st;
if (fstat(fd, &st) < 0) {
PFATAL("Unable to fstat '%s' " AFL_AS_ERR, afl_as_dup);
}
u32 f_len = st.st_size;
u8 *f_data = mmap(0, f_len, PROT_READ, MAP_PRIVATE, fd, 0);
if (f_data == MAP_FAILED) {
PFATAL("Unable to mmap file '%s' " AFL_AS_ERR, afl_as_dup);
}
close(fd);
// "AFL_AS" is a const str passed to getenv in afl-as.c
if (!memmem(f_data, f_len, "AFL_AS", strlen("AFL_AS") + 1)) {
FATAL(
"Looks like '%s' is not a valid symlink or copy of '%s/afl-as'. "
"It is a prerequisite to override system-wide 'as' for "
"instrumentation.",
afl_as_dup, afl_as);
}
if (munmap(f_data, f_len)) { PFATAL("unmap() failed"); }
ck_free(afl_as_dup);
#undef AFL_AS_ERR
insert_param(aflcc, "-B"); insert_param(aflcc, "-B");
insert_param(aflcc, afl_as); insert_param(aflcc, afl_as);

View File

@ -5,7 +5,7 @@
Originally written by Michal Zalewski Originally written by Michal Zalewski
Now maintained by Marc Heuse <mh@mh-sec.de>, Now maintained by Marc Heuse <mh@mh-sec.de>,
Heiko Eißfeldt <heiko.eissfeldt@hexco.de> and Heiko Eissfeldt <heiko.eissfeldt@hexco.de> and
Andrea Fioraldi <andreafioraldi@gmail.com> Andrea Fioraldi <andreafioraldi@gmail.com>
Copyright 2016, 2017 Google Inc. All rights reserved. Copyright 2016, 2017 Google Inc. All rights reserved.

View File

@ -7,7 +7,7 @@
Forkserver design by Jann Horn <jannhorn@googlemail.com> Forkserver design by Jann Horn <jannhorn@googlemail.com>
Now maintained by Marc Heuse <mh@mh-sec.de>, Now maintained by Marc Heuse <mh@mh-sec.de>,
Heiko Eißfeldt <heiko.eissfeldt@hexco.de> and Heiko Eissfeldt <heiko.eissfeldt@hexco.de> and
Andrea Fioraldi <andreafioraldi@gmail.com> and Andrea Fioraldi <andreafioraldi@gmail.com> and
Dominik Maier <mail@dmnk.co> Dominik Maier <mail@dmnk.co>
@ -27,6 +27,9 @@
*/ */
#include "config.h" #include "config.h"
#ifdef AFL_PERSISTENT_RECORD
#include "afl-fuzz.h"
#endif
#include "types.h" #include "types.h"
#include "debug.h" #include "debug.h"
#include "common.h" #include "common.h"
@ -2078,10 +2081,13 @@ store_persistent_record: {
u32 len = fsrv->persistent_record_len[entry]; u32 len = fsrv->persistent_record_len[entry];
if (likely(len && data)) { if (likely(len && data)) {
snprintf(fn, sizeof(fn), persistent_out_fmt, fsrv->persistent_record_dir, snprintf(
fn, sizeof(fn), persistent_out_fmt, fsrv->persistent_record_dir,
fsrv->persistent_record_cnt, writecnt++, fsrv->persistent_record_cnt, writecnt++,
afl->file_extension ? "." : "", ((afl_state_t *)(fsrv->afl_ptr))->file_extension ? "." : "",
afl->file_extension ? (const char *)afl->file_extension : ""); ((afl_state_t *)(fsrv->afl_ptr))->file_extension
? (const char *)((afl_state_t *)(fsrv->afl_ptr))->file_extension
: "");
int fd = open(fn, O_CREAT | O_TRUNC | O_WRONLY, 0644); int fd = open(fn, O_CREAT | O_TRUNC | O_WRONLY, 0644);
if (fd >= 0) { if (fd >= 0) {

View File

@ -5,7 +5,7 @@
Originally written by Michal Zalewski Originally written by Michal Zalewski
Now maintained by Marc Heuse <mh@mh-sec.de>, Now maintained by Marc Heuse <mh@mh-sec.de>,
Heiko Eißfeldt <heiko.eissfeldt@hexco.de> and Heiko Eissfeldt <heiko.eissfeldt@hexco.de> and
Andrea Fioraldi <andreafioraldi@gmail.com> Andrea Fioraldi <andreafioraldi@gmail.com>
Copyright 2016, 2017 Google Inc. All rights reserved. Copyright 2016, 2017 Google Inc. All rights reserved.

View File

@ -7,7 +7,7 @@
Forkserver design by Jann Horn <jannhorn@googlemail.com> Forkserver design by Jann Horn <jannhorn@googlemail.com>
Now maintained by by Marc Heuse <mh@mh-sec.de>, Now maintained by by Marc Heuse <mh@mh-sec.de>,
Heiko Eißfeldt <heiko.eissfeldt@hexco.de> and Heiko Eissfeldt <heiko.eissfeldt@hexco.de> and
Andrea Fioraldi <andreafioraldi@gmail.com> Andrea Fioraldi <andreafioraldi@gmail.com>
Copyright 2016, 2017 Google Inc. All rights reserved. Copyright 2016, 2017 Google Inc. All rights reserved.

View File

@ -5,7 +5,7 @@
Originally written by Michal Zalewski Originally written by Michal Zalewski
Now maintained by Marc Heuse <mh@mh-sec.de>, Now maintained by Marc Heuse <mh@mh-sec.de>,
Heiko Eißfeldt <heiko.eissfeldt@hexco.de> and Heiko Eissfeldt <heiko.eissfeldt@hexco.de> and
Andrea Fioraldi <andreafioraldi@gmail.com> Andrea Fioraldi <andreafioraldi@gmail.com>
Copyright 2016, 2017 Google Inc. All rights reserved. Copyright 2016, 2017 Google Inc. All rights reserved.

View File

@ -5,7 +5,7 @@
Originally written by Michal Zalewski Originally written by Michal Zalewski
Now maintained by Marc Heuse <mh@mh-sec.de>, Now maintained by Marc Heuse <mh@mh-sec.de>,
Heiko Eißfeldt <heiko.eissfeldt@hexco.de> and Heiko Eissfeldt <heiko.eissfeldt@hexco.de> and
Andrea Fioraldi <andreafioraldi@gmail.com> Andrea Fioraldi <andreafioraldi@gmail.com>
Copyright 2016, 2017 Google Inc. All rights reserved. Copyright 2016, 2017 Google Inc. All rights reserved.
@ -459,6 +459,24 @@ void bind_to_free_cpu(afl_state_t *afl) {
#endif /* HAVE_AFFINITY */ #endif /* HAVE_AFFINITY */
/* transforms spaces in a string to underscores (inplace) */
static void no_spaces(u8 *string) {
if (string) {
u8 *ptr = string;
while (*ptr != 0) {
if (*ptr == ' ') { *ptr = '_'; }
++ptr;
}
}
}
/* Shuffle an array of pointers. Might be slightly biased. */ /* Shuffle an array of pointers. Might be slightly biased. */
static void shuffle_ptrs(afl_state_t *afl, void **ptrs, u32 cnt) { static void shuffle_ptrs(afl_state_t *afl, void **ptrs, u32 cnt) {
@ -914,6 +932,11 @@ void perform_dry_run(afl_state_t *afl) {
res = calibrate_case(afl, q, use_mem, 0, 1); res = calibrate_case(afl, q, use_mem, 0, 1);
/* For AFLFast schedules we update the queue entry */
if (unlikely(afl->schedule >= FAST && afl->schedule <= RARE) && likely(q->exec_cksum)) {
q->n_fuzz_entry = q->exec_cksum % N_FUZZ_SIZE;
}
if (afl->stop_soon) { return; } if (afl->stop_soon) { return; }
if (res == afl->crash_mode || res == FSRV_RUN_NOBITS) { if (res == afl->crash_mode || res == FSRV_RUN_NOBITS) {
@ -1376,11 +1399,11 @@ void perform_dry_run(afl_state_t *afl) {
static void link_or_copy(u8 *old_path, u8 *new_path) { static void link_or_copy(u8 *old_path, u8 *new_path) {
s32 i = link(old_path, new_path); s32 i = link(old_path, new_path);
if (!i) { return; }
s32 sfd, dfd; s32 sfd, dfd;
u8 *tmp; u8 *tmp;
if (!i) { return; }
sfd = open(old_path, O_RDONLY); sfd = open(old_path, O_RDONLY);
if (sfd < 0) { PFATAL("Unable to open '%s'", old_path); } if (sfd < 0) { PFATAL("Unable to open '%s'", old_path); }
@ -1490,6 +1513,9 @@ void pivot_inputs(afl_state_t *afl) {
afl->fsrv.total_execs, use_name, afl->file_extension ? "." : "", afl->fsrv.total_execs, use_name, afl->file_extension ? "." : "",
afl->file_extension ? (const char *)afl->file_extension : ""); afl->file_extension ? (const char *)afl->file_extension : "");
u8 *pos = strrchr(nfn, '/');
no_spaces(pos + 30);
#else #else
nfn = alloc_printf( nfn = alloc_printf(

View File

@ -5,7 +5,7 @@
Originally written by Shengtuo Hu Originally written by Shengtuo Hu
Now maintained by Marc Heuse <mh@mh-sec.de>, Now maintained by Marc Heuse <mh@mh-sec.de>,
Heiko Eißfeldt <heiko.eissfeldt@hexco.de> and Heiko Eissfeldt <heiko.eissfeldt@hexco.de> and
Andrea Fioraldi <andreafioraldi@gmail.com> Andrea Fioraldi <andreafioraldi@gmail.com>
Dominik Maier <mail@dmnk.co> Dominik Maier <mail@dmnk.co>

View File

@ -5,7 +5,7 @@
Originally written by Michal Zalewski Originally written by Michal Zalewski
Now maintained by Marc Heuse <mh@mh-sec.de>, Now maintained by Marc Heuse <mh@mh-sec.de>,
Heiko Eißfeldt <heiko.eissfeldt@hexco.de> and Heiko Eissfeldt <heiko.eissfeldt@hexco.de> and
Andrea Fioraldi <andreafioraldi@gmail.com> Andrea Fioraldi <andreafioraldi@gmail.com>
Copyright 2016, 2017 Google Inc. All rights reserved. Copyright 2016, 2017 Google Inc. All rights reserved.

View File

@ -5,7 +5,7 @@
Originally written by Michal Zalewski Originally written by Michal Zalewski
Now maintained by Marc Heuse <mh@mh-sec.de>, Now maintained by Marc Heuse <mh@mh-sec.de>,
Heiko Eißfeldt <heiko.eissfeldt@hexco.de> and Heiko Eissfeldt <heiko.eissfeldt@hexco.de> and
Andrea Fioraldi <andreafioraldi@gmail.com> Andrea Fioraldi <andreafioraldi@gmail.com>
Copyright 2016, 2017 Google Inc. All rights reserved. Copyright 2016, 2017 Google Inc. All rights reserved.

View File

@ -5,7 +5,7 @@
Originally written by Michal Zalewski Originally written by Michal Zalewski
Now maintained by Marc Heuse <mh@mh-sec.de>, Now maintained by Marc Heuse <mh@mh-sec.de>,
Heiko Eißfeldt <heiko.eissfeldt@hexco.de> and Heiko Eissfeldt <heiko.eissfeldt@hexco.de> and
Andrea Fioraldi <andreafioraldi@gmail.com> Andrea Fioraldi <andreafioraldi@gmail.com>
Copyright 2016, 2017 Google Inc. All rights reserved. Copyright 2016, 2017 Google Inc. All rights reserved.

View File

@ -7,7 +7,7 @@
Forkserver design by Jann Horn <jannhorn@googlemail.com> Forkserver design by Jann Horn <jannhorn@googlemail.com>
Now maintained by by Marc Heuse <mh@mh-sec.de>, Now maintained by by Marc Heuse <mh@mh-sec.de>,
Heiko Eißfeldt <heiko.eissfeldt@hexco.de> and Heiko Eissfeldt <heiko.eissfeldt@hexco.de> and
Andrea Fioraldi <andreafioraldi@gmail.com> Andrea Fioraldi <andreafioraldi@gmail.com>
Copyright 2016, 2017 Google Inc. All rights reserved. Copyright 2016, 2017 Google Inc. All rights reserved.

View File

@ -5,7 +5,7 @@
Originally written by Michal Zalewski Originally written by Michal Zalewski
Now maintained by Marc Heuse <mh@mh-sec.de>, Now maintained by Marc Heuse <mh@mh-sec.de>,
Heiko Eißfeldt <heiko.eissfeldt@hexco.de> and Heiko Eissfeldt <heiko.eissfeldt@hexco.de> and
Andrea Fioraldi <andreafioraldi@gmail.com> and Andrea Fioraldi <andreafioraldi@gmail.com> and
Dominik Maier <mail@dmnk.co> Dominik Maier <mail@dmnk.co>
@ -829,8 +829,7 @@ void sync_fuzzers(afl_state_t *afl) {
if (afl->stop_soon) { goto close_sync; } if (afl->stop_soon) { goto close_sync; }
afl->syncing_party = sd_ent->d_name; afl->syncing_party = sd_ent->d_name;
afl->queued_imported += afl->queued_imported += save_if_interesting(afl, mem, new_len, fault);
save_if_interesting(afl, mem, new_len, fault);
afl->syncing_party = 0; afl->syncing_party = 0;
munmap(mem, st.st_size); munmap(mem, st.st_size);

View File

@ -5,7 +5,7 @@
Originally written by Michal Zalewski Originally written by Michal Zalewski
Now maintained by Marc Heuse <mh@mh-sec.de>, Now maintained by Marc Heuse <mh@mh-sec.de>,
Heiko Eißfeldt <heiko.eissfeldt@hexco.de> and Heiko Eissfeldt <heiko.eissfeldt@hexco.de> and
Andrea Fioraldi <andreafioraldi@gmail.com> Andrea Fioraldi <andreafioraldi@gmail.com>
Copyright 2016, 2017 Google Inc. All rights reserved. Copyright 2016, 2017 Google Inc. All rights reserved.

View File

@ -5,8 +5,9 @@
Originally written by Michal Zalewski Originally written by Michal Zalewski
Now maintained by Marc Heuse <mh@mh-sec.de>, Now maintained by Marc Heuse <mh@mh-sec.de>,
Heiko Eißfeldt <heiko.eissfeldt@hexco.de> and Dominik Meier <mail@dmnk.co>,
Andrea Fioraldi <andreafioraldi@gmail.com> Andrea Fioraldi <andreafioraldi@gmail.com>, and
Heiko Eissfeldt <heiko.eissfeldt@hexco.de>
Copyright 2016, 2017 Google Inc. All rights reserved. Copyright 2016, 2017 Google Inc. All rights reserved.
Copyright 2019-2024 AFLplusplus Project. All rights reserved. Copyright 2019-2024 AFLplusplus Project. All rights reserved.
@ -382,8 +383,8 @@ void write_stats_file(afl_state_t *afl, u32 t_bytes, double bitmap_cvg,
? 0 ? 0
: (cur_time - afl->last_find_time) / 1000), : (cur_time - afl->last_find_time) / 1000),
(runtime - (runtime -
(afl->calibration_time_us + afl->sync_time_us + afl->trim_time_us) / ((afl->calibration_time_us + afl->sync_time_us + afl->trim_time_us) /
1000) / 1000)) /
1000, 1000,
afl->calibration_time_us / 1000000, afl->sync_time_us / 1000000, afl->calibration_time_us / 1000000, afl->sync_time_us / 1000000,
afl->trim_time_us / 1000000, afl->fsrv.total_execs, afl->trim_time_us / 1000000, afl->fsrv.total_execs,

View File

@ -5,7 +5,7 @@
Originally written by Michal Zalewski Originally written by Michal Zalewski
Now maintained by Marc Heuse <mh@mh-sec.de>, Now maintained by Marc Heuse <mh@mh-sec.de>,
Heiko Eißfeldt <heiko.eissfeldt@hexco.de> and Heiko Eissfeldt <heiko.eissfeldt@hexco.de> and
Andrea Fioraldi <andreafioraldi@gmail.com> Andrea Fioraldi <andreafioraldi@gmail.com>
Copyright 2016, 2017 Google Inc. All rights reserved. Copyright 2016, 2017 Google Inc. All rights reserved.

View File

@ -5,7 +5,7 @@
Written by Marc Heuse <mh@mh-sec.de> for AFL++ Written by Marc Heuse <mh@mh-sec.de> for AFL++
Maintained by Marc Heuse <mh@mh-sec.de>, Maintained by Marc Heuse <mh@mh-sec.de>,
Heiko Eißfeldt <heiko.eissfeldt@hexco.de> Heiko Eissfeldt <heiko.eissfeldt@hexco.de>
Andrea Fioraldi <andreafioraldi@gmail.com> Andrea Fioraldi <andreafioraldi@gmail.com>
Dominik Maier <domenukk@gmail.com> Dominik Maier <domenukk@gmail.com>

View File

@ -7,7 +7,7 @@
Forkserver design by Jann Horn <jannhorn@googlemail.com> Forkserver design by Jann Horn <jannhorn@googlemail.com>
Now maintained by Marc Heuse <mh@mh-sec.de>, Now maintained by Marc Heuse <mh@mh-sec.de>,
Heiko Eißfeldt <heiko.eissfeldt@hexco.de> and Heiko Eissfeldt <heiko.eissfeldt@hexco.de> and
Andrea Fioraldi <andreafioraldi@gmail.com> Andrea Fioraldi <andreafioraldi@gmail.com>
Copyright 2016, 2017 Google Inc. All rights reserved. Copyright 2016, 2017 Google Inc. All rights reserved.

View File

@ -7,7 +7,7 @@
Forkserver design by Jann Horn <jannhorn@googlemail.com> Forkserver design by Jann Horn <jannhorn@googlemail.com>
Now maintained by Marc Heuse <mh@mh-sec.de>, Now maintained by Marc Heuse <mh@mh-sec.de>,
Heiko Eißfeldt <heiko.eissfeldt@hexco.de> and Heiko Eissfeldt <heiko.eissfeldt@hexco.de> and
Andrea Fioraldi <andreafioraldi@gmail.com> and Andrea Fioraldi <andreafioraldi@gmail.com> and
Dominik Maier <mail@dmnk.co> Dominik Maier <mail@dmnk.co>

View File

@ -7,7 +7,7 @@
Forkserver design by Jann Horn <jannhorn@googlemail.com> Forkserver design by Jann Horn <jannhorn@googlemail.com>
Now maintained by Marc Heuse <mh@mh-sec.de>, Now maintained by Marc Heuse <mh@mh-sec.de>,
Heiko Eißfeldt <heiko.eissfeldt@hexco.de> and Heiko Eissfeldt <heiko.eissfeldt@hexco.de> and
Andrea Fioraldi <andreafioraldi@gmail.com> and Andrea Fioraldi <andreafioraldi@gmail.com> and
Dominik Maier <mail@dmnk.co> Dominik Maier <mail@dmnk.co>