Skip to content
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

Merged
merged 4 commits into from
Sep 23, 2024

Conversation

R9295
Copy link
Collaborator

@R9295 R9295 commented Sep 18, 2024

No description provided.

@domenukk
Copy link
Member

Do we want the corpus traversing as function in the main lib/bolts?

@tokatoka
Copy link
Member

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();
Copy link
Member

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

Copy link
Collaborator Author

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.

Copy link
Member

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?

Copy link
Collaborator Author

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.

Copy link
Member

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.

Copy link
Collaborator Author

@R9295 R9295 Sep 23, 2024

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.

Copy link
Member

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

@domenukk domenukk merged commit 085db55 into AFLplusplus:main Sep 23, 2024
101 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants