update evaluation scripts

This commit is contained in:
Alwin Berger 2022-07-10 16:21:50 +02:00
parent aa7d78affe
commit e8ff45b205
6 changed files with 21 additions and 7 deletions

View File

@ -5,7 +5,7 @@ TARGET_TRACE = $(BENCHDIR)/traces/$(TNAME)_worst.ron
TARGET_EDGES = $(BENCHDIR)/edges/$(TNAME)_worst.ron
RUNTIME = 3600
INT_FLAG = ,fuzz_interrupt
COMMON_FLAGS = benchmark,dump_infos$(INT_FLAG)
COMMON_FLAGS = benchmark,dump_infos#,$(INT_FLAG)
NUM_JOB = 3
NUM_ITERATIONS = 10
LOCKFILE = /tmp/bench_sem
@ -16,7 +16,7 @@ $(BENCHDIR)/bin:
mkdir -p $@
$(BENCHDIR)/target_random:
cargo build --bin fuzzer --target-dir $@ --features $(COMMON_FLAGS),sched_queue,fuzz_random
cargo build --target-dir $@ --features $(COMMON_FLAGS),sched_queue,fuzz_random
$(BENCHDIR)/target_known_edges:
cargo build --bin fuzzer --target-dir $@ --features $(COMMON_FLAGS),feed_known_edges,sched_queue
@ -70,13 +70,13 @@ $(BENCHDIR)/bench_%.log: $(BENCHDIR)/target_% $(TARGET_TRACE)
$(RELEASE) & \
done
wait
for i in $@_*; do tail -n 1 $$i >> $@; done
for i in $@_*; do grep Stats $$i | tail -n 1 >> $@; done
benchmarks_noint: target/bench/bench_known_edges.log target/bench/bench_afl_queue.log target/bench/bench_afl_mapmax.log target/bench/bench_state.log target/bench/bench_state_afl.log \
target/bench/bench_graph.log target/bench/bench_graph_muta.log target/bench/bench_graph_afl.log target/bench/bench_graph_muta_afl.log
# target/bench/bench_graph_all.log target/bench/bench_state_afl_int.log
benchmarks_int: target/bench/bench_graph_muta_afl.log target/bench/bench_graph_muta_afl_int.log target/bench/bench_state_afl.log target/bench/bench_state_afl_int.log target/bench/bench_afl_mapmax.log
benchmarks_int: target/bench/bench_graph_muta_afl.log target/bench/bench_graph_muta_afl_int.log target/bench/bench_state_afl.log target/bench/bench_state_afl_int.log target/bench/bench_afl_mapmax.log target/bench/bench_afl_queue.log
benchmark_random: target/bench/bench_random.log
@ -97,12 +97,14 @@ reset_sem:
echo $(NUM_JOB) > $(LOCKFILE)
rm -rf $(LOCKFILE)_lockdir
%.case: %_inputs
%.case: %_inputs $(BENCHDIR)/target_random
mkdir -p $(BENCHDIR)/traces $(BENCHDIR)/edges
for i in $</*.case; do \
CASE=$$(basename -s.case $$i); echo $$CASE; \
PROG=$$(basename -s.case $@); \
./showmap.sh $(TARGET) --libafl-single $$i \
LD_LIBRARY_PATH=$(BENCHDIR)/target_random/debug $(BENCHDIR)/target_random/debug/showmap --libafl-snapshot tmp/dummy.qcow2 \
--libafl-out tmp/test_out --libafl-in tmp/test_in --libafl-kernel $(TARGET) \
--libafl-single $$i \
--libafl-edges $(BENCHDIR)/edges/$$PROG\_$$CASE.ron \
--libafl-traces $(BENCHDIR)/traces/$$PROG\_$$CASE.ron | \
grep "Qemu Ticks:"; \

View File

@ -342,7 +342,7 @@ fn fuzz(
let mut buf = target.as_slice();
let mut len = buf.len();
let mut int_tick : Option<u32> = None;
if len > IRQ_INPUT_BYTES_NUMBER as usize {
if len > IRQ_INPUT_BYTES_NUMBER as usize && IRQ_INPUT_BYTES_NUMBER!=0{
let mut t : [u8; 4] = [0,0,0,0]; // 4 extra bytes determine the tick to execute an interrupt
for i in 0..min(4,IRQ_INPUT_BYTES_NUMBER) {
t[i as usize]=buf[i as usize];

View File

@ -0,0 +1 @@
*.case

View File

@ -0,0 +1,4 @@
echo "" > best.case
echo "\x00\x00" > best_success.case
echo "\x05\x29\x07\x1f\x0b\x17\x00\x17" > worst_trace.case
echo "\xFF\xF6\xFC\xF8\xFD\xFD\xFF\xFD" > worst.case

View File

@ -0,0 +1 @@
*.case

View File

@ -0,0 +1,6 @@
echo "\xff\xff" > best.case
echo "\xff\xff\x00\x00" > best_success.case
echo "\xff\x05\x05\x29\x07\x1f\x0b\x17\x00\x17" > worst_trace.case
echo "\xff\x05\xFF\xF6\xFC\xF8\xFD\xFD\xFF\xFD" > worst.case
echo "\x3F\x05\xFF\xF6\xFC\xF8\xFD\xFD\xFF\xFD" > worst_preempt.case
echo "\x93\x1F\xFF\xF6\xFC\xF8\xFD\xFD\xFF\xFD" > worst_preempt_adv.case