-
-
Notifications
You must be signed in to change notification settings - Fork 347
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #58 from AFLplusplus/real_time_benchmarks
Introspection
- Loading branch information
Showing
23 changed files
with
934 additions
and
37 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,63 @@ | ||
PWD=`pwd` | ||
FUZZER_NAME="fuzzer_libpng" | ||
|
||
all: | ||
# Build the libpng libfuzzer library | ||
cargo build --release | ||
|
||
# Build the libpng harness | ||
$(PWD)/target/release/libafl_cxx \ | ||
$(PWD)/harness.cc \ | ||
$(PWD)/libpng-1.6.37/.libs/libpng16.a \ | ||
-I$(PWD)/libpng-1.6.37/ \ | ||
-o $(FUZZER_NAME) \ | ||
-lm -lz | ||
|
||
run: all | ||
./$(FUZZER_NAME) & | ||
sleep 0.2 | ||
./$(FUZZER_NAME) >/dev/null 2>/dev/null & | ||
|
||
short_test: all | ||
timeout 11s ./$(FUZZER_NAME) & | ||
sleep 0.2 | ||
timeout 10s taskset -c 0 ./$(FUZZER_NAME) >/dev/null 2>/dev/null & | ||
timeout 10s taskset -c 1 ./$(FUZZER_NAME) >/dev/null 2>/dev/null & | ||
timeout 10s taskset -c 2 ./$(FUZZER_NAME) >/dev/null 2>/dev/null & | ||
timeout 10s taskset -c 3 ./$(FUZZER_NAME) >/dev/null 2>/dev/null & | ||
|
||
test: all | ||
timeout 60s ./$(FUZZER_NAME) & | ||
sleep 0.2 | ||
timeout 59s taskset 0x00000001 ./$(FUZZER_NAME) >/dev/null 2>/dev/null & | ||
timeout 59s taskset 0x00000002 ./$(FUZZER_NAME) >/dev/null 2>/dev/null & | ||
timeout 59s taskset 0x00000004 ./$(FUZZER_NAME) >/dev/null 2>/dev/null & | ||
timeout 59s taskset 0x00000008 ./$(FUZZER_NAME) >/dev/null 2>/dev/null & | ||
# timeout 59s taskset 0x00000010 ./$(FUZZER_NAME) >/dev/null 2>/dev/null & | ||
# timeout 59s taskset 0x00000020 ./$(FUZZER_NAME) >/dev/null 2>/dev/null & | ||
# timeout 59s taskset 0x00000040 ./$(FUZZER_NAME) >/dev/null 2>/dev/null & | ||
# timeout 59s taskset 0x00000080 ./$(FUZZER_NAME) >/dev/null 2>/dev/null & | ||
# timeout 59s taskset 0x00000100 ./$(FUZZER_NAME) >/dev/null 2>/dev/null & | ||
# timeout 59s taskset 0x00000200 ./$(FUZZER_NAME) >/dev/null 2>/dev/null & | ||
# timeout 59s taskset 0x00000400 ./$(FUZZER_NAME) >/dev/null 2>/dev/null & | ||
# timeout 59s taskset 0x00000800 ./$(FUZZER_NAME) >/dev/null 2>/dev/null & | ||
# timeout 59s taskset 0x00001000 ./$(FUZZER_NAME) >/dev/null 2>/dev/null & | ||
# timeout 59s taskset 0x00002000 ./$(FUZZER_NAME) >/dev/null 2>/dev/null & | ||
# timeout 59s taskset 0x00004000 ./$(FUZZER_NAME) >/dev/null 2>/dev/null & | ||
# timeout 59s taskset 0x00008000 ./$(FUZZER_NAME) >/dev/null 2>/dev/null & | ||
# timeout 59s taskset 0x00010000 ./$(FUZZER_NAME) >/dev/null 2>/dev/null & | ||
# timeout 59s taskset 0x00020000 ./$(FUZZER_NAME) >/dev/null 2>/dev/null & | ||
# timeout 59s taskset 0x00040000 ./$(FUZZER_NAME) >/dev/null 2>/dev/null & | ||
# timeout 59s taskset 0x00080000 ./$(FUZZER_NAME) >/dev/null 2>/dev/null & | ||
# timeout 59s taskset 0x00100000 ./$(FUZZER_NAME) >/dev/null 2>/dev/null & | ||
# timeout 59s taskset 0x00200000 ./$(FUZZER_NAME) >/dev/null 2>/dev/null & | ||
# timeout 59s taskset 0x00400000 ./$(FUZZER_NAME) >/dev/null 2>/dev/null & | ||
# timeout 59s taskset 0x00800000 ./$(FUZZER_NAME) >/dev/null 2>/dev/null & | ||
# timeout 59s taskset 0x01000000 ./$(FUZZER_NAME) >/dev/null 2>/dev/null & | ||
# timeout 59s taskset 0x02000000 ./$(FUZZER_NAME) >/dev/null 2>/dev/null & | ||
# timeout 59s taskset 0x04000000 ./$(FUZZER_NAME) >/dev/null 2>/dev/null & | ||
# timeout 59s taskset 0x08000000 ./$(FUZZER_NAME) >/dev/null 2>/dev/null & | ||
# timeout 59s taskset 0x10000000 ./$(FUZZER_NAME) >/dev/null 2>/dev/null & | ||
# timeout 59s taskset 0x20000000 ./$(FUZZER_NAME) >/dev/null 2>/dev/null & | ||
# timeout 59s taskset 0x40000000 ./$(FUZZER_NAME) >/dev/null 2>/dev/null & | ||
# timeout 59s taskset 0x80000000 ./$(FUZZER_NAME) >/dev/null 2>/dev/null & |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
[package] | ||
name = "libafl" | ||
version = "0.2.0" | ||
version = "0.2.1" | ||
authors = ["Andrea Fioraldi <[email protected]>", "Dominik Maier <[email protected]>"] | ||
description = "Slot your own fuzzers together and extend their features using Rust" | ||
documentation = "https://docs.rs/libafl" | ||
|
@@ -40,10 +40,11 @@ default = ["std", "anymap_debug", "derive", "llmp_compression"] | |
std = [] # print, sharedmap, ... support | ||
anymap_debug = ["serde_json"] # uses serde_json to Debug the anymap trait. Disable for smaller footprint. | ||
derive = ["libafl_derive"] # provide derive(SerdeAny) macro. | ||
llmp_small_maps = [] # reduces initial map size for llmp | ||
llmp_debug = ["backtrace"] # Enables debug output for LLMP | ||
llmp_compression = [] # llmp compression using GZip | ||
llmp_bind_public = [] # If set, llmp will bind to 0.0.0.0, allowing cross-device communication. Binds to localhost by default. | ||
llmp_compression = [] # llmp compression using GZip | ||
llmp_debug = ["backtrace"] # Enables debug output for LLMP | ||
llmp_small_maps = [] # reduces initial map size for llmp | ||
introspection = [] # Include performance statistics of the fuzzing pipeline | ||
|
||
[[example]] | ||
name = "llmp_test" | ||
|
@@ -60,7 +61,7 @@ erased-serde = "0.3.12" | |
postcard = { version = "0.5.1", features = ["alloc"] } # no_std compatible serde serialization fromat | ||
static_assertions = "1.1.0" | ||
ctor = "0.1.20" | ||
libafl_derive = { version = "0.1.0", optional = true, path = "../libafl_derive" } | ||
libafl_derive = { optional = true, path = "../libafl_derive", version = "0.2.1" } | ||
serde_json = { version = "1.0", optional = true, default-features = false, features = ["alloc"] } # an easy way to debug print SerdeAnyMap | ||
compression = { version = "0.1.5" } | ||
num_enum = "0.5.1" | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
//! Architecture agnostic processor features | ||
#[cfg(not(any(target_arch = "x86_64", target_arch = "x86")))] | ||
use crate::utils::current_nanos; | ||
|
||
// TODO: Add more architectures, using C code, see | ||
// https://github.com/google/benchmark/blob/master/src/cycleclock.h | ||
// Or using llvm intrinsics (if they ever should become available in stable rust?) | ||
|
||
/// Read a timestamp for measurements. | ||
/// | ||
/// This function is a wrapper around different ways to get a timestamp, fast | ||
/// In this way, an experiment only has to | ||
/// change this implementation rather than every instead of [`cpu::read_time_counter`] | ||
/// It is using [`rdtsc`] on `x86_64` and `x86`. | ||
#[cfg(any(target_arch = "x86_64", target_arch = "x86"))] | ||
#[must_use] | ||
pub fn read_time_counter() -> u64 { | ||
unsafe { core::arch::x86_64::_rdtsc() } | ||
} | ||
|
||
/// Read a timestamp for measurements. | ||
/// | ||
/// This function is a wrapper around different ways to get a timestamp, fast | ||
/// In this way, an experiment only has to | ||
/// change this implementation rather than every instead of [`cpu::read_time_counter`] | ||
/// On unsupported architectures, it's falling back to normal system time, in millis. | ||
#[cfg(not(any(target_arch = "x86_64", target_arch = "x86")))] | ||
pub fn read_time_counter() -> u64 { | ||
current_nanos() | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.