Misc libafl-fuzz improvements (#2463)

* 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
This commit is contained in:
Aarnav 2024-07-31 14:54:11 +02:00 committed by GitHub
parent 8fb80c3f3a
commit 6d4f071eaa
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 17 additions and 7 deletions

View File

@ -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)

View File

@ -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,

View File

@ -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')]
@ -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)]