Skip to content

Commit 6d4f071

Browse files
authored
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
1 parent 8fb80c3 commit 6d4f071

3 files changed

Lines changed: 17 additions & 7 deletions

File tree

fuzzers/others/libafl-fuzz/src/corpus.rs

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -144,13 +144,20 @@ pub fn check_autoresume(
144144
// Copy all our seeds to queue
145145
for file in std::fs::read_dir(intial_inputs)? {
146146
let path = file?.path();
147-
std::fs::copy(
147+
let cpy_res = std::fs::copy(
148148
&path,
149149
queue_dir.join(path.file_name().ok_or(Error::illegal_state(format!(
150150
"file {} in input directory does not have a filename",
151151
path.display()
152152
)))?),
153-
)?;
153+
);
154+
if let Err(e) = cpy_res {
155+
if matches!(e.kind(), io::ErrorKind::InvalidInput) {
156+
println!("skipping {} since it is not a regular file", path.display());
157+
} else {
158+
return Err(e.into());
159+
}
160+
}
154161
}
155162
}
156163
Ok(file)

fuzzers/others/libafl-fuzz/src/feedback/seed.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ where
3434
pub fn new(inner: A, opt: &Opt) -> Self {
3535
Self {
3636
inner,
37-
ignore_timeouts: opt.ignore_seed_issues,
37+
ignore_timeouts: opt.ignore_timeouts,
3838
ignore_seed_issues: opt.ignore_seed_issues,
3939
exit_on_seed_issues: opt.exit_on_seed_issues,
4040
phantom: PhantomData,

fuzzers/others/libafl-fuzz/src/main.rs

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -134,8 +134,8 @@ struct Opt {
134134
/// sync to a foreign fuzzer queue directory (requires -M, can be specified up to 32 times)
135135
#[arg(short = 'F', num_args = 32)]
136136
foreign_sync_dirs: Vec<PathBuf>,
137-
/// fuzzer dictionary (see README.md, specify up to 4 times)
138-
#[arg(short = 'x', num_args = 4)]
137+
/// fuzzer dictionary (see README.md)
138+
#[arg(short = 'x')]
139139
dicts: Vec<PathBuf>,
140140
// Environment + CLI variables
141141
#[arg(short = 'G')]
@@ -152,13 +152,16 @@ struct Opt {
152152
#[arg(short = 'V')]
153153
fuzz_for_seconds: Option<usize>,
154154

155+
/// timeout for each run
156+
#[arg(short = 't', default_value_t = 1000)]
157+
hang_timeout: u64,
158+
155159
// Environment Variables
156160
#[clap(skip)]
157161
bench_just_one: bool,
158162
#[clap(skip)]
159163
bench_until_crash: bool,
160-
#[clap(skip)]
161-
hang_timeout: u64,
164+
162165
#[clap(skip)]
163166
debug_child: bool,
164167
#[clap(skip)]

0 commit comments

Comments
 (0)