Skip to content

Commit

Permalink
2.34b
Browse files Browse the repository at this point in the history
  • Loading branch information
thomas-huet committed Sep 21, 2016
1 parent 62b46d5 commit 74130d3
Show file tree
Hide file tree
Showing 6 changed files with 57 additions and 5 deletions.
13 changes: 11 additions & 2 deletions afl-fuzz.c
Original file line number Diff line number Diff line change
Expand Up @@ -4924,8 +4924,11 @@ static u8 fuzz_one(char** argv) {

#endif /* ^IGNORE_FINDS */

if (not_on_tty)
ACTF("Fuzzing test case #%u (%u total)...", current_entry, queued_paths);
if (not_on_tty) {
ACTF("Fuzzing test case #%u (%u total, %llu uniq crashes found)...",
current_entry, queued_paths, unique_crashes);
fflush(stdout);
}

/* Map the test case into memory. */

Expand Down Expand Up @@ -6922,6 +6925,12 @@ static void check_if_tty(void) {

struct winsize ws;

if (getenv("AFL_NO_UI")) {
OKF("Disabling the UI because AFL_NO_UI is set.");
not_on_tty = 1;
return;
}

if (ioctl(1, TIOCGWINSZ, &ws)) {

if (errno == ENOTTY) {
Expand Down
2 changes: 1 addition & 1 deletion afl-gcc.c
Original file line number Diff line number Diff line change
Expand Up @@ -233,7 +233,7 @@ static void edit_params(u32 argc, char** argv) {
FATAL("ASAN and MSAN are mutually exclusive");

if (getenv("AFL_HARDEN"))
FATAL("ABSAN and AFL_HARDEN are mutually exclusive");
FATAL("ASAN and AFL_HARDEN are mutually exclusive");

cc_params[cc_par_cnt++] = "-U_FORTIFY_SOURCE";
cc_params[cc_par_cnt++] = "-fsanitize=address";
Expand Down
2 changes: 1 addition & 1 deletion config.h
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@

/* Version string: */

#define VERSION "2.33b"
#define VERSION "2.34b"

/******************************************************
* *
Expand Down
8 changes: 8 additions & 0 deletions docs/ChangeLog
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,14 @@ Not sure if you should upgrade? The lowest currently recommended version
is 2.31b. If you're stuck on an earlier release, it's strongly advisable
to get on with the times.

--------------
Version 2.34b:
--------------

- Added a note about afl-tmin to technical_details.txt.

- Added support for AFL_NO_UI, as suggested by Leo Barnes.

--------------
Version 2.33b:
--------------
Expand Down
4 changes: 4 additions & 0 deletions docs/env_variables.txt
Original file line number Diff line number Diff line change
Expand Up @@ -145,6 +145,10 @@ checks or alter some of the more exotic semantics of the tool:
without disrupting the afl-fuzz process itself. This is useful, among other
things, for bootstrapping libdislocator.so.

- Setting AFL_NO_UI inhibits the UI altogether, and just periodically prints
some basic stats. This behavior is also automatically triggered when the
output from afl-fuzz is redirected to a file or to a pipe.

- If you are Jakub, you may need AFL_I_DONT_CARE_ABOUT_MISSING_CRASHES.
Others need not apply.

Expand Down
33 changes: 32 additions & 1 deletion docs/technical_details.txt
Original file line number Diff line number Diff line change
Expand Up @@ -279,7 +279,38 @@ and the number of execve() calls spent on the process, selecting the block size
and stepover to match. The average per-file gains are around 5-20%.

The standalone afl-tmin tool uses a more exhaustive, iterative algorithm, and
also attempts to perform alphabet normalization on the trimmed files.
also attempts to perform alphabet normalization on the trimmed files. The
operation of afl-tmin is as follows.

First, the tool automatically selects the operating mode. If the initial input
crashes the target binary, afl-tmin will run in non-instrumented mode, simply
keeping any tweaks that produce a simpler file but still crash the target. If
the target is non-crashing, the tool uses an instrumented mode and keeps only
the tweaks that produce exactly the same execution path.

The actual minimization algorithm is:

1) Attempt to zero large blocks of data with large stepovers. Empirically,
this is shown to reduce the number of execs by preempting finer-grained
efforts later on.

2) Perform a block deletion pass with decreasing block sizes and stepovers,
binary-search-style.

3) Perform alphabet normalization by counting unique characters and trying
to bulk-replace each with a zero value.

4) As a last result, perform byte-by-byte normalization on non-zero bytes.

Instead of zeroing with a 0x00 byte, afl-tmin uses the ASCII digit '0'. This
is done because such a modification is much less likely to interfere with
text parsing, so it is more likely to result in successful minimization of
text files.

The algorithm used here is less involved than some other test case
minimization approaches proposed in academic work, but requires far fewer
executions and tends to produce comparable results in most real-world
applications.

6) Fuzzing strategies
---------------------
Expand Down

0 comments on commit 74130d3

Please sign in to comment.