Skip to content

Commit

Permalink
remove InsTrim
Browse files Browse the repository at this point in the history
  • Loading branch information
vanhauser-thc committed Mar 25, 2021
1 parent 447d232 commit 0029c1a
Show file tree
Hide file tree
Showing 15 changed files with 29 additions and 1,284 deletions.
5 changes: 1 addition & 4 deletions GNUmakefile.llvm
Original file line number Diff line number Diff line change
Expand Up @@ -304,7 +304,7 @@ ifeq "$(TEST_MMAP)" "1"
endif

PROGS_ALWAYS = ./afl-cc ./afl-compiler-rt.o ./afl-compiler-rt-32.o ./afl-compiler-rt-64.o
PROGS = $(PROGS_ALWAYS) ./afl-llvm-pass.so ./SanitizerCoveragePCGUARD.so ./split-compares-pass.so ./split-switches-pass.so ./cmplog-routines-pass.so ./cmplog-instructions-pass.so ./afl-llvm-dict2file.so ./compare-transform-pass.so ./libLLVMInsTrim.so ./afl-ld-lto ./afl-llvm-lto-instrumentlist.so ./afl-llvm-lto-instrumentation.so ./SanitizerCoverageLTO.so
PROGS = $(PROGS_ALWAYS) ./afl-llvm-pass.so ./SanitizerCoveragePCGUARD.so ./split-compares-pass.so ./split-switches-pass.so ./cmplog-routines-pass.so ./cmplog-instructions-pass.so ./afl-llvm-dict2file.so ./compare-transform-pass.so ./afl-ld-lto ./afl-llvm-lto-instrumentlist.so ./afl-llvm-lto-instrumentation.so ./SanitizerCoverageLTO.so

# If prerequisites are not given, warn, do not build anything, and exit with code 0
ifeq "$(LLVMVER)" ""
Expand Down Expand Up @@ -382,9 +382,6 @@ endif
instrumentation/afl-llvm-common.o: instrumentation/afl-llvm-common.cc instrumentation/afl-llvm-common.h
$(CXX) $(CFLAGS) $(CPPFLAGS) `$(LLVM_CONFIG) --cxxflags` -fno-rtti -fPIC -std=$(LLVM_STDCXX) -c $< -o $@

./libLLVMInsTrim.so: instrumentation/LLVMInsTrim.so.cc instrumentation/MarkNodes.cc instrumentation/afl-llvm-common.o | test_deps
-$(CXX) $(CLANG_CPPFL) -DLLVMInsTrim_EXPORTS -fno-rtti -fPIC -std=$(LLVM_STDCXX) -shared $< instrumentation/MarkNodes.cc -o $@ $(CLANG_LFL) instrumentation/afl-llvm-common.o

./afl-llvm-pass.so: instrumentation/afl-llvm-pass.so.cc instrumentation/afl-llvm-common.o | test_deps
ifeq "$(LLVM_MIN_4_0_1)" "0"
$(info [!] N-gram branch coverage instrumentation is not available for llvm version $(LLVMVER))
Expand Down
1 change: 0 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -370,7 +370,6 @@ There are many more options and modes available however these are most of the
time less effective. See:
* [instrumentation/README.ctx.md](instrumentation/README.ctx.md)
* [instrumentation/README.ngram.md](instrumentation/README.ngram.md)
* [instrumentation/README.instrim.md](instrumentation/README.instrim.md)

afl++ performs "never zero" counting in its bitmap. You can read more about this
here:
Expand Down
2 changes: 2 additions & 0 deletions docs/Changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@ sending a mail to <[email protected]>.
to allow replay of non-reproducable crashes, see
AFL_PERSISTENT_RECORD in config.h and docs/envs.h
- default cmplog level (-l) is now 2, better efficiency.
- afl-cc:
- Removed InsTrim instrumentation as it is not as good as PCGUARD

### Version ++3.12c (release)
- afl-fuzz:
Expand Down
43 changes: 0 additions & 43 deletions docs/PATCHES.md

This file was deleted.

27 changes: 4 additions & 23 deletions docs/env_variables.md
Original file line number Diff line number Diff line change
Expand Up @@ -130,16 +130,15 @@ Then there are a few specific features that are only available in instrumentatio
PCGUARD - our own pcgard based instrumentation (default)
NATIVE - clang's original pcguard based instrumentation
CLASSIC - classic AFL (map[cur_loc ^ prev_loc >> 1]++) (default)
CFG - InsTrim instrumentation (see below)
LTO - LTO instrumentation (see below)
CTX - context sensitive instrumentation (see below)
NGRAM-x - deeper previous location coverage (from NGRAM-2 up to NGRAM-16)
GCC - outdated gcc instrumentation
CLANG - outdated clang instrumentation
In CLASSIC (default) and CFG/INSTRIM you can also specify CTX and/or
NGRAM, seperate the options with a comma "," then, e.g.:
`AFL_LLVM_INSTRUMENT=CFG,CTX,NGRAM-4`
Not that this is a good idea to use both CTX and NGRAM :)
In CLASSIC you can also specify CTX and/or NGRAM, seperate the options
with a comma "," then, e.g.:
`AFL_LLVM_INSTRUMENT=CLASSIC,CTX,NGRAM-4`
Note that this is actually not a good idea to use both CTX and NGRAM :)

### LTO

Expand Down Expand Up @@ -173,24 +172,6 @@ Then there are a few specific features that are only available in instrumentatio

See [instrumentation/README.lto.md](../instrumentation/README.lto.md) for more information.

### INSTRIM

This feature increases the speed by ~15% without any disadvantages to the
classic instrumentation.

Note that there is also an LTO version (if you have llvm 11 or higher) -
that is the best instrumentation we have. Use `afl-clang-lto` to activate.
The InsTrim LTO version additionally has all the options and features of
LTO (see above).

- Setting `AFL_LLVM_INSTRIM` or `AFL_LLVM_INSTRUMENT=CFG` activates this mode

- Setting `AFL_LLVM_INSTRIM_LOOPHEAD=1` expands on INSTRIM to optimize loops.
afl-fuzz will only be able to see the path the loop took, but not how
many times it was called (unless it is a complex loop).

See [instrumentation/README.instrim.md](../instrumentation/README.instrim.md)

### NGRAM

- Setting `AFL_LLVM_NGRAM_SIZE` or `AFL_LLVM_INSTRUMENT=NGRAM-{value}`
Expand Down
3 changes: 0 additions & 3 deletions docs/perf_tips.md
Original file line number Diff line number Diff line change
Expand Up @@ -69,9 +69,6 @@ If you are only interested in specific parts of the code being fuzzed, you can
instrument_files the files that are actually relevant. This improves the speed and
accuracy of afl. See instrumentation/README.instrument_list.md

Also use the InsTrim mode on larger binaries, this improves performance and
coverage a lot.

## 4. Profile and optimize the binary

Check for any parameters or settings that obviously improve performance. For
Expand Down
Loading

0 comments on commit 0029c1a

Please sign in to comment.