-
Notifications
You must be signed in to change notification settings - Fork 2
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Handling panic exceptions in the concolic fuzzing loop of LibAFL #6
Comments
In this example: Line 408 in 12e63ee
we solve the problem using the first strategy, by randomizing the generated mutations. Note that instead of introducing a new dependency to the |
Whenever a mutation is failing in Line 442 in 7c1b9ee
|
As if let Some(mut mutations) = mutations {
state.rand_mut().shuffle(&mut mutations);
// ...
} Just note that the pub trait Rand: Debug + Serialize + DeserializeOwned {
// ...
/// Shuffles the given slice in place.
fn shuffle<T>(&mut self, target: &mut [T]) {
// Grabbed from rand library implementation.
for i in (1..target.len()).rev() {
// invariant: elements with index > i have been locked in place.
target.swap(i, self.below((i + 1) as u64) as usize);
}
}
// ...
} BTW, I'll create a pull request to perform this modification in the Dockerfile (which honestly I don't like the approach). |
You can also directly put your modifications in one of the latest versions of https://github.com/sfu-rsl/LibAFL as the sed patch that I made in the Dockerfile is temporary. The branch containing that patch in symrustc is also temporary, and will have to be removed at some point when ready... |
Note: Instead of using |
Yeah, this made more sense and I pushed the changes to sfu-rsl/LibAFL#1. |
Note: Adding a non-concolic (pure fuzzing) client to the "concolic client + server" setting does not seem to solve this path exploration problem compared to the above first listed randomization solution (or at least solve it quicker than having to stop it after 3-4 minutes of run). |
While running the LibAFL main loop:
symrustc/Dockerfile
Line 536 in 653042a
the execution of
fuzz_one
in https://github.com/sfu-rsl/LibAFL/blob/59bb8e61856b22047f8e6e2787a3f6d90ae99006/libafl/src/fuzzer/mod.rs#L573 is repetitively randomly made, in the sense that theinput
selected from the set of potential corpus candidates appears to be a random choice at each iteration offuzz_one
, e.g. while going from iterationn
to iterationn+1
. Note thatfuzz_one
first starts with executing the concolic version (using the LibAFL SymCC Rust backend, and this is done only one time):symrustc/libfuzzer_rust_concolic_instance/fuzzer/src/main.rs
Line 284 in 653042a
However, the Z3 mutations
m
subsequently generated bygenerate_mutations
:https://github.com/sfu-rsl/LibAFL/blob/59bb8e61856b22047f8e6e2787a3f6d90ae99006/libafl/src/stages/concolic.rs#L94
are always deterministic considered:
https://github.com/sfu-rsl/LibAFL/blob/59bb8e61856b22047f8e6e2787a3f6d90ae99006/libafl/src/stages/concolic.rs#L385
In particular, if a mutation happens to fail with
panic
at iterationn
in the non-concolic version:symrustc/libfuzzer_rust_concolic_instance/fuzzer/src/main.rs
Line 185 in 653042a
then all remaining mutations in
m
(not yet considered) are immediately discarded. This is undesired as the unvisited mutations may reveal important concolic paths, that may be important for the overall progress of the concolic binary exploration.Whereas the fuzzing loop can anyway be persistently configured to resume its computation and start fresh at iteration
n+1
, this appears to be still unsatisfying, even in the situation wheren+1
is generating the same set of mutationsm
(as the same unvisited mutations would turn out to be all unvisited again).In this issue, we propose to solve this problem using, among others, the following mutually exclusive solutions:
m
to hope to increase the probability ofn+1
to present mutations randomly more interesting thann
.n+1
to remember which previous mutations failed inn
, so thatn+1
will never re-execute them again.The text was updated successfully, but these errors were encountered: