Skip to content

Commit 9f3b098

Browse files
Composing feedback (#85)
* composing feedbacks as logic operations and bump to 0.2 * adapt fuzzers and libafl_frida * fix windows build
1 parent 9e9d95f commit 9f3b098

File tree

19 files changed

+386
-260
lines changed

19 files changed

+386
-260
lines changed

fuzzers/baby_fuzzer/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "baby_fuzzer"
3-
version = "0.1.0"
3+
version = "0.2.0"
44
authors = ["Andrea Fioraldi <[email protected]>", "Dominik Maier <[email protected]>"]
55
edition = "2018"
66

fuzzers/baby_fuzzer/src/main.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -56,13 +56,13 @@ pub fn main() {
5656
StdRand::with_seed(current_nanos()),
5757
// Corpus that will be evolved, we keep it in memory for performance
5858
InMemoryCorpus::new(),
59-
// Feedbacks to rate the interestingness of an input
60-
tuple_list!(MaxMapFeedback::new_with_observer(&observer)),
59+
// Feedback to rate the interestingness of an input
60+
MaxMapFeedback::new_with_observer(&observer),
6161
// Corpus in which we store solutions (crashes in this example),
6262
// on disk so the user can get them after stopping the fuzzer
6363
OnDiskCorpus::new(PathBuf::from("./crashes")).unwrap(),
6464
// Feedbacks to recognize an input as solution
65-
tuple_list!(CrashFeedback::new()),
65+
CrashFeedback::new(),
6666
);
6767

6868
// Setup a basic mutator with a mutational stage

fuzzers/frida_libpng/Cargo.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "frida_libpng"
3-
version = "0.1.0"
3+
version = "0.2.0"
44
authors = ["Andrea Fioraldi <[email protected]>", "Dominik Maier <[email protected]>"]
55
edition = "2018"
66
build = "build.rs"
@@ -25,7 +25,7 @@ libafl = { path = "../../libafl/", features = [ "std", "llmp_compression" ] } #,
2525
capstone = "0.8.0"
2626
frida-gum = { version = "0.4", git = "https://github.com/s1341/frida-rust", features = [ "auto-download", "event-sink", "invocation-listener"] }
2727
#frida-gum = { version = "0.4", path = "../../../frida-rust/frida-gum", features = [ "auto-download", "event-sink", "invocation-listener"] }
28-
libafl_frida = { path = "../../libafl_frida", version = "0.1.0" }
28+
libafl_frida = { path = "../../libafl_frida", version = "0.2.0" }
2929
lazy_static = "1.4.0"
3030
libc = "0.2"
3131
libloading = "0.7.0"

fuzzers/frida_libpng/src/fuzzer.rs

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ use libafl::{
1212
inprocess::InProcessExecutor, timeout::TimeoutExecutor, Executor, ExitKind, HasExecHooks,
1313
HasExecHooksTuple, HasObservers, HasObserversHooks,
1414
},
15+
feedback_or,
1516
feedbacks::{CrashFeedback, MaxMapFeedback, TimeoutFeedback},
1617
fuzzer::{Fuzzer, StdFuzzer},
1718
inputs::{HasTargetBytes, Input},
@@ -276,17 +277,13 @@ unsafe fn fuzz(
276277
// Corpus that will be evolved, we keep it in memory for performance
277278
InMemoryCorpus::new(),
278279
// Feedbacks to rate the interestingness of an input
279-
tuple_list!(MaxMapFeedback::new_with_observer_track(
280-
&edges_observer,
281-
true,
282-
false
283-
)),
280+
MaxMapFeedback::new_with_observer_track(&edges_observer, true, false),
284281
// Corpus in which we store solutions (crashes in this example),
285282
// on disk so the user can get them after stopping the fuzzer
286283
OnDiskCorpus::new_save_meta(objective_dir, Some(OnDiskMetadataFormat::JsonPretty))
287284
.unwrap(),
288285
// Feedbacks to recognize an input as solution
289-
tuple_list!(
286+
feedback_or!(
290287
CrashFeedback::new(),
291288
TimeoutFeedback::new(),
292289
AsanErrorsFeedback::new()

fuzzers/libfuzzer_libmozjpeg/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "libfuzzer_libmozjpeg"
3-
version = "0.1.0"
3+
version = "0.2.0"
44
authors = ["Andrea Fioraldi <[email protected]>", "Dominik Maier <[email protected]>"]
55
edition = "2018"
66

fuzzers/libfuzzer_libmozjpeg/src/lib.rs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ use libafl::{
88
corpus::{Corpus, InMemoryCorpus, OnDiskCorpus, RandCorpusScheduler},
99
events::setup_restarting_mgr_std,
1010
executors::{inprocess::InProcessExecutor, ExitKind},
11+
feedback_or,
1112
feedbacks::{CrashFeedback, MaxMapFeedback},
1213
fuzzer::{Fuzzer, StdFuzzer},
1314
mutators::scheduled::{havoc_mutations, StdScheduledMutator},
@@ -76,7 +77,7 @@ fn fuzz(corpus_dirs: Vec<PathBuf>, objective_dir: PathBuf, broker_port: u16) ->
7677
// Corpus that will be evolved, we keep it in memory for performance
7778
InMemoryCorpus::new(),
7879
// Feedbacks to rate the interestingness of an input
79-
tuple_list!(
80+
feedback_or!(
8081
MaxMapFeedback::new_with_observer(&edges_observer),
8182
MaxMapFeedback::new_with_observer(&cmps_observer),
8283
MaxMapFeedback::new_with_observer(&allocs_observer)
@@ -85,7 +86,7 @@ fn fuzz(corpus_dirs: Vec<PathBuf>, objective_dir: PathBuf, broker_port: u16) ->
8586
// on disk so the user can get them after stopping the fuzzer
8687
OnDiskCorpus::new(objective_dir).unwrap(),
8788
// Feedbacks to recognize an input as solution
88-
tuple_list!(CrashFeedback::new()),
89+
CrashFeedback::new(),
8990
)
9091
});
9192

fuzzers/libfuzzer_libpng/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "libfuzzer_libpng"
3-
version = "0.1.0"
3+
version = "0.2.0"
44
authors = ["Andrea Fioraldi <[email protected]>", "Dominik Maier <[email protected]>"]
55
edition = "2018"
66

fuzzers/libfuzzer_libpng/src/lib.rs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ use libafl::{
1212
},
1313
events::{setup_restarting_mgr_std, EventManager},
1414
executors::{inprocess::InProcessExecutor, ExitKind, TimeoutExecutor},
15+
feedback_or,
1516
feedbacks::{CrashFeedback, MaxMapFeedback, TimeFeedback, TimeoutFeedback},
1617
fuzzer::{Fuzzer, StdFuzzer},
1718
mutators::scheduled::{havoc_mutations, StdScheduledMutator},
@@ -76,15 +77,15 @@ fn fuzz(corpus_dirs: Vec<PathBuf>, objective_dir: PathBuf, broker_port: u16) ->
7677
// Corpus that will be evolved, we keep it in memory for performance
7778
InMemoryCorpus::new(),
7879
// Feedbacks to rate the interestingness of an input
79-
tuple_list!(
80+
feedback_or!(
8081
MaxMapFeedback::new_with_observer_track(&edges_observer, true, false),
8182
TimeFeedback::new()
8283
),
8384
// Corpus in which we store solutions (crashes in this example),
8485
// on disk so the user can get them after stopping the fuzzer
8586
OnDiskCorpus::new(objective_dir).unwrap(),
8687
// Feedbacks to recognize an input as solution
87-
tuple_list!(CrashFeedback::new(), TimeoutFeedback::new()),
88+
feedback_or!(CrashFeedback::new(), TimeoutFeedback::new()),
8889
)
8990
});
9091

fuzzers/libfuzzer_stb_image/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "libfuzzer_stb_image"
3-
version = "0.1.0"
3+
version = "0.2.0"
44
authors = ["Andrea Fioraldi <[email protected]>", "Dominik Maier <[email protected]>"]
55
edition = "2018"
66
build = "build.rs"

fuzzers/libfuzzer_stb_image/src/main.rs

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ use libafl::{
1111
},
1212
events::setup_restarting_mgr_std,
1313
executors::{inprocess::InProcessExecutor, ExitKind},
14+
feedback_or,
1415
feedbacks::{CrashFeedback, MaxMapFeedback, TimeFeedback},
1516
fuzzer::{Fuzzer, StdFuzzer},
1617
mutators::scheduled::{havoc_mutations, StdScheduledMutator},
@@ -73,15 +74,15 @@ fn fuzz(corpus_dirs: Vec<PathBuf>, objective_dir: PathBuf, broker_port: u16) ->
7374
// Corpus that will be evolved, we keep it in memory for performance
7475
InMemoryCorpus::new(),
7576
// Feedbacks to rate the interestingness of an input
76-
tuple_list!(
77+
feedback_or!(
7778
MaxMapFeedback::new_with_observer_track(&edges_observer, true, false),
7879
TimeFeedback::new()
7980
),
8081
// Corpus in which we store solutions (crashes in this example),
8182
// on disk so the user can get them after stopping the fuzzer
8283
OnDiskCorpus::new(objective_dir).unwrap(),
83-
// Feedbacks to recognize an input as solution
84-
tuple_list!(CrashFeedback::new()),
84+
// Feedback to recognize an input as solution
85+
CrashFeedback::new(),
8586
)
8687
});
8788

0 commit comments

Comments
 (0)