mirror of
https://github.com/AFLplusplus/AFLplusplus.git
synced 2025-06-19 21:13:45 +00:00
code review: fixed some typos
This commit is contained in:
@ -14,13 +14,13 @@ disturbance by uninteresting code being exercised.
|
|||||||
|
|
||||||
For this purpose, a "partial instrumentation" support en par with llvm sancov
|
For this purpose, a "partial instrumentation" support en par with llvm sancov
|
||||||
is provided by afl++ that allows you to specify on a source file and function
|
is provided by afl++ that allows you to specify on a source file and function
|
||||||
level which should be compiled with or without instrumentation.
|
level which function should be compiled with or without instrumentation.
|
||||||
|
|
||||||
Note: When using PCGUARD mode - and have llvm 12+ - you can use this instead:
|
Note: When using PCGUARD mode - and have llvm 12+ - you can use this instead:
|
||||||
https://clang.llvm.org/docs/SanitizerCoverage.html#partially-disabling-instrumentation
|
https://clang.llvm.org/docs/SanitizerCoverage.html#partially-disabling-instrumentation
|
||||||
|
|
||||||
the llvm sancov list format is fully supported by afl++, however afl++ has
|
The llvm sancov list format is fully supported by afl++, however afl++ has
|
||||||
more flexbility.
|
more flexibility.
|
||||||
|
|
||||||
## 2) Building the LLVM module
|
## 2) Building the LLVM module
|
||||||
|
|
||||||
@ -35,13 +35,13 @@ The only required change is that you need to set either the environment variable
|
|||||||
AFL_LLVM_ALLOWLIST or AFL_LLVM_DENYLIST set with a filename.
|
AFL_LLVM_ALLOWLIST or AFL_LLVM_DENYLIST set with a filename.
|
||||||
|
|
||||||
That file then contains the filenames or functions that should be instrumented
|
That file then contains the filenames or functions that should be instrumented
|
||||||
(AFL_LLVM_ALLOWLIST) or should specifically NOT instrumentd (AFL_LLVM_DENYLIST).
|
(AFL_LLVM_ALLOWLIST) or should specifically NOT be instrumented (AFL_LLVM_DENYLIST).
|
||||||
|
|
||||||
For matching, the function/filename that is being compiled must end in the
|
For matching, the function/filename that is being compiled must end in the
|
||||||
function/filename entry contained in this the instrument file list (to avoid
|
function/filename entry contained in this instrument file list (to avoid
|
||||||
breaking the matching when absolute paths are used during compilation).
|
breaking the matching when absolute paths are used during compilation).
|
||||||
|
|
||||||
**NOTE:** In optimization functions might be inlined and then not match!
|
**NOTE:** In builds with optimization enabled functions might be inlined and would not match!
|
||||||
|
|
||||||
For example if your source tree looks like this:
|
For example if your source tree looks like this:
|
||||||
```
|
```
|
||||||
@ -52,7 +52,7 @@ project/feature_b/b1.cpp
|
|||||||
project/feature_b/b2.cpp
|
project/feature_b/b2.cpp
|
||||||
```
|
```
|
||||||
|
|
||||||
and you only want to test feature_a, then create a the instrument file list file containing:
|
and you only want to test feature_a, then create a instrument file list file containing:
|
||||||
```
|
```
|
||||||
feature_a/a1.cpp
|
feature_a/a1.cpp
|
||||||
feature_a/a2.cpp
|
feature_a/a2.cpp
|
||||||
@ -69,7 +69,7 @@ exists somewhere else in the project directories.
|
|||||||
You can also specify function names. Note that for C++ the function names
|
You can also specify function names. Note that for C++ the function names
|
||||||
must be mangled to match!
|
must be mangled to match!
|
||||||
|
|
||||||
afl++ is intelligent to identify if an entry is a filename or a function.
|
afl++ is able to identify if an entry is a filename or a function.
|
||||||
However if you want to be sure (and compliant to the sancov allow/blocklist
|
However if you want to be sure (and compliant to the sancov allow/blocklist
|
||||||
format), you can specify source file entries like this:
|
format), you can specify source file entries like this:
|
||||||
```
|
```
|
||||||
@ -79,7 +79,7 @@ and function entries like this:
|
|||||||
```
|
```
|
||||||
fun: MallocFoo
|
fun: MallocFoo
|
||||||
```
|
```
|
||||||
Note that whitespace is ignored and comments (`# foo`) supported.
|
Note that whitespace is ignored and comments (`# foo`) are supported.
|
||||||
|
|
||||||
## 4) UNIX-style pattern matching
|
## 4) UNIX-style pattern matching
|
||||||
You can add UNIX-style pattern matching in the the instrument file list entries.
|
You can add UNIX-style pattern matching in the the instrument file list entries.
|
||||||
|
@ -331,8 +331,8 @@ bool isInInstrumentList(llvm::Function *F) {
|
|||||||
|
|
||||||
bool return_default = true;
|
bool return_default = true;
|
||||||
|
|
||||||
// is this a function with code? If it is external we dont instrument it
|
// is this a function with code? If it is external we don't instrument it
|
||||||
// anyway and cant be in the the instrument file list. Or if it is ignored.
|
// anyway and it can't be in the instrument file list. Or if it is it is ignored.
|
||||||
if (!F->size() || isIgnoreFunction(F)) return false;
|
if (!F->size() || isIgnoreFunction(F)) return false;
|
||||||
|
|
||||||
if (!denyListFiles.empty() || !denyListFunctions.empty()) {
|
if (!denyListFiles.empty() || !denyListFunctions.empty()) {
|
||||||
@ -476,7 +476,7 @@ bool isInInstrumentList(llvm::Function *F) {
|
|||||||
else {
|
else {
|
||||||
|
|
||||||
// we could not find out the location. in this case we say it is not
|
// we could not find out the location. in this case we say it is not
|
||||||
// in the the instrument file list
|
// in the instrument file list
|
||||||
if (!be_quiet)
|
if (!be_quiet)
|
||||||
WARNF(
|
WARNF(
|
||||||
"No debug information found for function %s, will be "
|
"No debug information found for function %s, will be "
|
||||||
@ -489,7 +489,7 @@ bool isInInstrumentList(llvm::Function *F) {
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// if we do not have a the instrument file list return true
|
// if we do not have a instrument file list return true
|
||||||
if (!allowListFiles.empty() || !allowListFunctions.empty()) {
|
if (!allowListFiles.empty() || !allowListFunctions.empty()) {
|
||||||
|
|
||||||
return_default = false;
|
return_default = false;
|
||||||
@ -632,8 +632,8 @@ bool isInInstrumentList(llvm::Function *F) {
|
|||||||
#endif
|
#endif
|
||||||
else {
|
else {
|
||||||
|
|
||||||
// we could not find out the location. in this case we say it is not
|
// we could not find out the location. In this case we say it is not
|
||||||
// in the the instrument file list
|
// in the instrument file list
|
||||||
if (!be_quiet)
|
if (!be_quiet)
|
||||||
WARNF(
|
WARNF(
|
||||||
"No debug information found for function %s, will not be "
|
"No debug information found for function %s, will not be "
|
||||||
|
@ -853,7 +853,7 @@ void __afl_manual_init(void) {
|
|||||||
|
|
||||||
if (getenv("AFL_DEBUG"))
|
if (getenv("AFL_DEBUG"))
|
||||||
fprintf(stderr,
|
fprintf(stderr,
|
||||||
"DEBUG: disabled instrumenation because of "
|
"DEBUG: disabled instrumentation because of "
|
||||||
"AFL_DISABLE_LLVM_INSTRUMENTATION\n");
|
"AFL_DISABLE_LLVM_INSTRUMENTATION\n");
|
||||||
|
|
||||||
}
|
}
|
||||||
@ -901,7 +901,7 @@ __attribute__((constructor(0))) void __afl_auto_early(void) {
|
|||||||
void __sanitizer_cov_trace_pc_guard(uint32_t *guard) {
|
void __sanitizer_cov_trace_pc_guard(uint32_t *guard) {
|
||||||
|
|
||||||
// For stability analysis, if you want to know to which function unstable
|
// For stability analysis, if you want to know to which function unstable
|
||||||
// edge IDs belong to - uncomment, recompile+install llvm_mode, recompile
|
// edge IDs belong - uncomment, recompile+install llvm_mode, recompile
|
||||||
// the target. libunwind and libbacktrace are better solutions.
|
// the target. libunwind and libbacktrace are better solutions.
|
||||||
// Set AFL_DEBUG_CHILD_OUTPUT=1 and run afl-fuzz with 2>file to capture
|
// Set AFL_DEBUG_CHILD_OUTPUT=1 and run afl-fuzz with 2>file to capture
|
||||||
// the backtrace output
|
// the backtrace output
|
||||||
|
Reference in New Issue
Block a user