-
-
Notifications
You must be signed in to change notification settings - Fork 330
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
libafl-fuzz: fix not loading seeds recursively from directories #2532
Conversation
Do we want the corpus traversing as function in the main lib/bolts? |
we already have it StdState::next_file() i think you should export some of them as public functions and use them instead of writing this from scratch |
Err(e) => return Err(e), | ||
} | ||
} | ||
self.reset_initial_files_state(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Isn't this the exact opposite of what we want?
We want to add all initial files in order to then load them - not clear them(?)
Keep in mind most fuzzers can restart during input loading
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@domenukk we are popping them anyways. For libafl-fuzz, we want to copy the corpora first to the queue directory before loading them, and thus the path will be different already and we cannot re-use remaining_initial_files
etc.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't fully get it sorry, is remaining_initial_files
refilled after this point then? Maybe not reset inside this method?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@domenukk remaining initial files will be empty by the time the walking the corpus or loading the corpus is done but do_no_reenter
may still be populated and this is why we need to reset the state.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I guess I don't have to fully get it - but still, reset_initial_files_state
shoudn't be in a walk_initial_inputs
method, they are unrelated.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@domenukk why not? I'm thinking from a usage perspective. what's the point of having files in do_not_reenter
after we're done walking? we won't traverse those symlinks again in load_initial_inputs
without resetting the state. So IMO it makes sense to reset it after anyways.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok I'm not 100% convinced this is the cleanest implementation, but it is the one we have :)
No description provided.