diff --git a/fuzzers/FRET/Cargo.toml b/fuzzers/FRET/Cargo.toml index dbd105cb40..302aa229bf 100644 --- a/fuzzers/FRET/Cargo.toml +++ b/fuzzers/FRET/Cargo.toml @@ -5,7 +5,7 @@ authors = ["Alwin Berger "] edition = "2021" [features] -default = ["std", "snapshot_fast", "restarting", "do_hash_notify_state", "config_stg", "fuzz_int", "shortcut", "trace_job_response_times" ] +default = ["std", "snapshot_fast", "restarting", "do_hash_notify_state", "do_hash_notify_value", "config_stg", "fuzz_int", "shortcut", "trace_job_response_times" ] std = [] # Exec environemnt basics snapshot_restore = [] @@ -20,6 +20,7 @@ observe_edges = [] # observe cfg edges observe_hitcounts = [ "observe_edges" ] # reduces edge granularity observe_systemstate = [] do_hash_notify_state = [] +do_hash_notify_value = [] trace_job_response_times = [ "trace_stg" ] trace_stg = [ "observe_systemstate" ] trace_reads = [ "trace_stg", "trace_job_response_times" ] diff --git a/fuzzers/FRET/benchmark/Snakefile b/fuzzers/FRET/benchmark/Snakefile index b5c0994ffc..431b2e40b8 100644 --- a/fuzzers/FRET/benchmark/Snakefile +++ b/fuzzers/FRET/benchmark/Snakefile @@ -1,6 +1,6 @@ import csv import os -def_flags="--release --no-default-features --features std,snapshot_fast,restarting,do_hash_notify_state,fuzz_int,trace_job_response_times" +def_flags="--release --no-default-features --features std,snapshot_fast,restarting,do_hash_notify_state,do_hash_notify_value,fuzz_int,trace_job_response_times" remote="remote/" RUNTIME=1800 NUM_ITERS=2 @@ -224,7 +224,7 @@ rule trace2gantt: rule quicktest: input: - expand("timedump/{fuzzer}/{target}{variant}#{num}.time", fuzzer=['feedgeneration100', 'stg'], target=['copter'], variant=['_seq_full', '_par_full', '_seq_stateful_full', '_par_stateful_full', '_seq_dataflow_full'], num=range(0,int( 4 ))), + expand("timedump/{fuzzer}/{target}{variant}#{num}.time", fuzzer=['feedgeneration100', 'stg'], target=['copter'], variant=['_seq_full', '_par_full', '_seq_stateful_full', '_par_stateful_full', '_seq_dataflow_full'], num=range(0,int( 3 ))), rule all_bins: input: diff --git a/fuzzers/FRET/benchmark/target_symbols.csv b/fuzzers/FRET/benchmark/target_symbols.csv index b0960b33e4..475e0bc6aa 100644 --- a/fuzzers/FRET/benchmark/target_symbols.csv +++ b/fuzzers/FRET/benchmark/target_symbols.csv @@ -24,17 +24,17 @@ release_seq_stateful_bytes,main_release,FUZZ_INPUT,4096,trigger_Qemu_break,T3, release_par_stateful_full,main_release,FUZZ_INPUT,4096,trigger_Qemu_break,T3,0#10000;1#5000 release_par_stateful_int,main_release,FUZZ_INPUT,4096,trigger_Qemu_break,T3,0#10000;1#5000 release_par_stateful_bytes,main_release,FUZZ_INPUT,4096,trigger_Qemu_break,T3, -coptere_seq_full,main_osek,FUZZ_INPUT,4096,trigger_Qemu_break,FC,0#20000 -coptere_seq_full,main_osek,FUZZ_INPUT,4096,trigger_Qemu_break,FC,0#20000 -coptere_seq_int,main_osek,FUZZ_INPUT,4096,trigger_Qemu_break,FC,0#20000 -coptere_seq_bytes,main_osek,FUZZ_INPUT,4096,trigger_Qemu_break,FC, -coptere_par_full,main_osek,FUZZ_INPUT,4096,trigger_Qemu_break,FC,0#20000 -coptere_par_int,main_osek,FUZZ_INPUT,4096,trigger_Qemu_break,FC,0#20000 -coptere_par_bytes,main_osek,FUZZ_INPUT,4096,trigger_Qemu_break,FC, -coptere_seq_stateful_full,main_osek,FUZZ_INPUT,4096,trigger_Qemu_break,FC,0#20000 -coptere_seq_stateful_int,main_osek,FUZZ_INPUT,4096,trigger_Qemu_break,FC,0#20000 -coptere_seq_stateful_bytes,main_osek,FUZZ_INPUT,4096,trigger_Qemu_break,FC, -coptere_par_stateful_full,main_osek,FUZZ_INPUT,4096,trigger_Qemu_break,FC,0#20000 -coptere_par_stateful_int,main_osek,FUZZ_INPUT,4096,trigger_Qemu_break,FC,0#20000 -coptere_par_stateful_bytes,main_osek,FUZZ_INPUT,4096,trigger_Qemu_break,FC, -coptere_seq_dataflow_full,main_osek,FUZZ_INPUT,4096,trigger_Qemu_break,FC,0#20000 \ No newline at end of file +copter_seq_full,main_osek,FUZZ_INPUT,4096,trigger_Qemu_break,FC,0#20000 +copter_seq_full,main_osek,FUZZ_INPUT,4096,trigger_Qemu_break,FC,0#20000 +copter_seq_int,main_osek,FUZZ_INPUT,4096,trigger_Qemu_break,FC,0#20000 +copter_seq_bytes,main_osek,FUZZ_INPUT,4096,trigger_Qemu_break,FC, +copter_par_full,main_osek,FUZZ_INPUT,4096,trigger_Qemu_break,FC,0#20000 +copter_par_int,main_osek,FUZZ_INPUT,4096,trigger_Qemu_break,FC,0#20000 +copter_par_bytes,main_osek,FUZZ_INPUT,4096,trigger_Qemu_break,FC, +copter_seq_stateful_full,main_osek,FUZZ_INPUT,4096,trigger_Qemu_break,FC,0#20000 +copter_seq_stateful_int,main_osek,FUZZ_INPUT,4096,trigger_Qemu_break,FC,0#20000 +copter_seq_stateful_bytes,main_osek,FUZZ_INPUT,4096,trigger_Qemu_break,FC, +copter_par_stateful_full,main_osek,FUZZ_INPUT,4096,trigger_Qemu_break,FC,0#20000 +copter_par_stateful_int,main_osek,FUZZ_INPUT,4096,trigger_Qemu_break,FC,0#20000 +copter_par_stateful_bytes,main_osek,FUZZ_INPUT,4096,trigger_Qemu_break,FC, +copter_seq_dataflow_full,main_osek,FUZZ_INPUT,4096,trigger_Qemu_break,FC,0#20000 \ No newline at end of file diff --git a/fuzzers/FRET/src/cli.rs b/fuzzers/FRET/src/cli.rs index bcb659a496..c79e4e17e6 100644 --- a/fuzzers/FRET/src/cli.rs +++ b/fuzzers/FRET/src/cli.rs @@ -78,9 +78,12 @@ pub fn set_env_from_config(kernel : &PathBuf, path : &PathBuf) { let mut reader = csv::Reader::from_path(path).expect("CSV read from config failed"); let p = kernel.as_path(); let stem = p.file_stem().expect("Kernel filename error").to_str().unwrap(); + let mut found = false; for r in reader.records() { let rec = r.expect("CSV entry error"); if stem == &rec[0] { + println!("Config from file {:?}", rec); + found = true; std::env::set_var("FUZZ_MAIN", &rec[1]); std::env::set_var("FUZZ_INPUT", &rec[2]); std::env::set_var("FUZZ_INPUT_LEN", &rec[3]); @@ -88,6 +91,9 @@ pub fn set_env_from_config(kernel : &PathBuf, path : &PathBuf) { break; } } + if !found { + eprintln!("No config found for kernel {:?}", stem); + } } } diff --git a/fuzzers/FRET/src/systemstate/target_os/freertos/mod.rs b/fuzzers/FRET/src/systemstate/target_os/freertos/mod.rs index d21a0ccc17..d040730aec 100644 --- a/fuzzers/FRET/src/systemstate/target_os/freertos/mod.rs +++ b/fuzzers/FRET/src/systemstate/target_os/freertos/mod.rs @@ -296,7 +296,7 @@ pub struct RefinedTCB { pub priority: u32, pub base_priority: u32, mutexes_held: u32, - // notify_value: u32, + notify_value: u32, notify_state: u8, } @@ -307,6 +307,8 @@ impl PartialEq for RefinedTCB { && self.base_priority == other.base_priority; #[cfg(feature = "do_hash_notify_state")] let ret = ret && self.notify_state == other.notify_state; + #[cfg(feature = "do_hash_notify_value")] + let ret = ret && self.notify_state == other.notify_state; ret } } @@ -318,7 +320,8 @@ impl Hash for RefinedTCB { self.mutexes_held.hash(state); #[cfg(feature = "do_hash_notify_state")] self.notify_state.hash(state); - // self.notify_value.hash(state); + #[cfg(feature = "do_hash_notify_value")] + self.notify_value.hash(state); } } @@ -336,7 +339,7 @@ impl RefinedTCB { priority: input.uxPriority, base_priority: input.uxBasePriority, mutexes_held: input.uxMutexesHeld, - // notify_value: input.ulNotifiedValue[0], + notify_value: input.ulNotifiedValue[0], notify_state: input.ucNotifyState[0], } } @@ -354,7 +357,7 @@ impl RefinedTCB { priority: input.uxPriority, base_priority: input.uxBasePriority, mutexes_held: input.uxMutexesHeld, - // notify_value: input.ulNotifiedValue[0], + notify_value: input.ulNotifiedValue[0], notify_state: input.ucNotifyState[0], } }