Add sections about fuzzing APIs with callbacks#53
Merged
fitzgen merged 3 commits intorust-fuzz:masterfrom Feb 18, 2026
Merged
Conversation
fitzgen
reviewed
Feb 17, 2026
Member
fitzgen
left a comment
There was a problem hiding this comment.
The content looks good ot me, but this isn't really about callbacks, it is more about ASan and accessing data. For example, you could have
pub fn api_with_return(user_data: &[u8]) -> &[u8] {
let dangling_data_ptr: *mut u32 = process_user_data(user_data);
let data_len: usize = HARDCODED_VALUE;
let data = unsafe { std::slice::from_raw_parts(dangling_data_ptr, data_len) };
data
}
which would exhibit the same issues as the callback example.
I think a better title for this page would be something like
Writing Oracles that Access Data
or something along those lines.
Contributor
Author
|
Thank you for this great suggestion! I have updated the text. :) |
fitzgen
approved these changes
Feb 18, 2026
Member
fitzgen
left a comment
There was a problem hiding this comment.
Thanks, just one final nitpick below.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
I found that Rust APIs with callbacks need special handling when writing fuzzing harnesses, and I wrote a simple crate touched to make things easier. I think it may be great to add a section to make more people aware of this problem.