mirror of
https://github.com/AFLplusplus/AFLplusplus.git
synced 2025-06-15 11:28:08 +00:00
Enhancement on Deterministic stage (#1972)
* fuzzer: init commit based on aflpp 60dc37a8cf
* fuzzers: adding the skip variables and initialize
* log: profile the det/havoc finding
* log: add profile log output
* fuzzers: sperate log/skipdet module
* fuzzers: add quick eff_map calc
* fuzzers: add skip_eff_map in fuzz_one
* fuzzers: mark whole input space in eff_map
* fuzzers: add undet bit threshold to skip some seeds
* fuzzers: fix one byte overflow
* fuzzers: fix overflow
* fix code format
* add havoc only again
* code format
* remove log to INTROSPECTION, rename skipdet module
* rename skipdet module
* remove log to stats
* clean redundant code
* code format
* remove redundant code format check
* remove redundant doc
* remove redundant objects
* clean files
* change -d to default skipdet
* disable deterministic when using CUSTOM_MUTATOR
* revert fix
This commit is contained in:
@ -149,6 +149,48 @@ struct tainted {
|
||||
|
||||
};
|
||||
|
||||
struct inf_profile {
|
||||
|
||||
u32 inf_skipped_bytes; /* Inference Stage Profiling */
|
||||
u64 inf_execs_cost, inf_time_cost;
|
||||
|
||||
};
|
||||
|
||||
/* ToDo: add cmplog profile as well */
|
||||
struct havoc_profile {
|
||||
|
||||
u32 queued_det_stage, /* Det/Havoc Stage Profiling */
|
||||
queued_havoc_stage, total_queued_det, edge_det_stage, edge_havoc_stage,
|
||||
total_det_edge;
|
||||
|
||||
u64 det_stage_time, havoc_stage_time, total_det_time;
|
||||
|
||||
};
|
||||
|
||||
struct skipdet_entry {
|
||||
|
||||
u8 continue_inf, done_eff;
|
||||
u32 undet_bits, quick_eff_bytes;
|
||||
|
||||
u8 *skip_eff_map, /* we'v finish the eff_map */
|
||||
*done_inf_map; /* some bytes are not done yet */
|
||||
|
||||
};
|
||||
|
||||
struct skipdet_global {
|
||||
|
||||
u8 use_skip_havoc;
|
||||
|
||||
u32 undet_bits_threshold;
|
||||
|
||||
u64 last_cov_undet;
|
||||
|
||||
u8 *virgin_det_bits; /* global fuzzed bits */
|
||||
|
||||
struct inf_profile *inf_prof;
|
||||
|
||||
};
|
||||
|
||||
struct queue_entry {
|
||||
|
||||
u8 *fname; /* File name for the test case */
|
||||
@ -203,6 +245,8 @@ struct queue_entry {
|
||||
|
||||
struct queue_entry *mother; /* queue entry this based on */
|
||||
|
||||
struct skipdet_entry *skipdet_e;
|
||||
|
||||
};
|
||||
|
||||
struct extra_data {
|
||||
@ -247,6 +291,8 @@ enum {
|
||||
/* 19 */ STAGE_CUSTOM_MUTATOR,
|
||||
/* 20 */ STAGE_COLORIZATION,
|
||||
/* 21 */ STAGE_ITS,
|
||||
/* 22 */ STAGE_INF,
|
||||
/* 23 */ STAGE_QUICK,
|
||||
|
||||
STAGE_NUM_MAX
|
||||
|
||||
@ -782,6 +828,11 @@ typedef struct afl_state {
|
||||
* is too large) */
|
||||
struct queue_entry **q_testcase_cache;
|
||||
|
||||
/* Global Profile Data for deterministic/havoc-splice stage */
|
||||
struct havoc_profile *havoc_prof;
|
||||
|
||||
struct skipdet_global *skipdet_g;
|
||||
|
||||
#ifdef INTROSPECTION
|
||||
char mutation[8072];
|
||||
char m_tmp[4096];
|
||||
@ -1232,6 +1283,13 @@ AFL_RAND_RETURN rand_next(afl_state_t *afl);
|
||||
/* probability between 0.0 and 1.0 */
|
||||
double rand_next_percent(afl_state_t *afl);
|
||||
|
||||
/* SkipDet Functions */
|
||||
|
||||
u8 skip_deterministic_stage(afl_state_t *, u8 *, u8 *, u32, u64);
|
||||
u8 is_det_timeout(u64, u8);
|
||||
|
||||
void plot_profile_data(afl_state_t *, struct queue_entry *);
|
||||
|
||||
/**** Inline routines ****/
|
||||
|
||||
/* Generate a random number (from 0 to limit - 1). This may
|
||||
|
@ -52,6 +52,18 @@
|
||||
/* Default file permission umode when creating files (default: 0600) */
|
||||
#define DEFAULT_PERMISSION 0600
|
||||
|
||||
/* SkipDet's global configuration */
|
||||
|
||||
#define MINIMAL_BLOCK_SIZE 64
|
||||
#define SMALL_DET_TIME (60 * 1000 * 1000U)
|
||||
#define MAXIMUM_INF_EXECS (16 * 1024U)
|
||||
#define MAXIMUM_QUICK_EFF_EXECS (64 * 1024U)
|
||||
#define THRESHOLD_DEC_TIME (20 * 60 * 1000U)
|
||||
|
||||
/* Set the Prob of selecting eff_bytes 3 times more than original,
|
||||
Now disabled */
|
||||
#define EFF_HAVOC_RATE 3
|
||||
|
||||
/* CMPLOG/REDQUEEN TUNING
|
||||
*
|
||||
* Here you can modify tuning and solving options for CMPLOG.
|
||||
|
@ -126,7 +126,8 @@ typedef struct afl_forkserver {
|
||||
u8 *out_file, /* File to fuzz, if any */
|
||||
*target_path; /* Path of the target */
|
||||
|
||||
FILE *plot_file; /* Gnuplot output file */
|
||||
FILE *plot_file, /* Gnuplot output file */
|
||||
*det_plot_file;
|
||||
|
||||
/* Note: last_run_timed_out is u32 to send it to the child as 4 byte array */
|
||||
u32 last_run_timed_out; /* Traced process timed out? */
|
||||
|
Reference in New Issue
Block a user