Skip to content

Commit

Permalink
Misc libafl-fuzz improvements (AFLplusplus#2463)
Browse files Browse the repository at this point in the history
* libafl-fuzz: ignore seeds that are not regular files

* libafl-fuzz: remove 4 dict files limit

* libafl-fuzz: clippy

* libafl-fuzz: add -t option

* libafl-fuzz: fix typo in seed feedback
  • Loading branch information
R9295 authored Jul 31, 2024
1 parent 8fb80c3 commit 6d4f071
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 7 deletions.
11 changes: 9 additions & 2 deletions fuzzers/others/libafl-fuzz/src/corpus.rs
Original file line number Diff line number Diff line change
Expand Up @@ -144,13 +144,20 @@ pub fn check_autoresume(
// Copy all our seeds to queue
for file in std::fs::read_dir(intial_inputs)? {
let path = file?.path();
std::fs::copy(
let cpy_res = std::fs::copy(
&path,
queue_dir.join(path.file_name().ok_or(Error::illegal_state(format!(
"file {} in input directory does not have a filename",
path.display()
)))?),
)?;
);
if let Err(e) = cpy_res {
if matches!(e.kind(), io::ErrorKind::InvalidInput) {
println!("skipping {} since it is not a regular file", path.display());
} else {
return Err(e.into());
}
}
}
}
Ok(file)
Expand Down
2 changes: 1 addition & 1 deletion fuzzers/others/libafl-fuzz/src/feedback/seed.rs
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ where
pub fn new(inner: A, opt: &Opt) -> Self {
Self {
inner,
ignore_timeouts: opt.ignore_seed_issues,
ignore_timeouts: opt.ignore_timeouts,
ignore_seed_issues: opt.ignore_seed_issues,
exit_on_seed_issues: opt.exit_on_seed_issues,
phantom: PhantomData,
Expand Down
11 changes: 7 additions & 4 deletions fuzzers/others/libafl-fuzz/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -134,8 +134,8 @@ struct Opt {
/// sync to a foreign fuzzer queue directory (requires -M, can be specified up to 32 times)
#[arg(short = 'F', num_args = 32)]
foreign_sync_dirs: Vec<PathBuf>,
/// fuzzer dictionary (see README.md, specify up to 4 times)
#[arg(short = 'x', num_args = 4)]
/// fuzzer dictionary (see README.md)
#[arg(short = 'x')]
dicts: Vec<PathBuf>,
// Environment + CLI variables
#[arg(short = 'G')]
Expand All @@ -152,13 +152,16 @@ struct Opt {
#[arg(short = 'V')]
fuzz_for_seconds: Option<usize>,

/// timeout for each run
#[arg(short = 't', default_value_t = 1000)]
hang_timeout: u64,

// Environment Variables
#[clap(skip)]
bench_just_one: bool,
#[clap(skip)]
bench_until_crash: bool,
#[clap(skip)]
hang_timeout: u64,

#[clap(skip)]
debug_child: bool,
#[clap(skip)]
Expand Down

0 comments on commit 6d4f071

Please sign in to comment.