fuzzing: Implement structure-aware Cache fuzzer and improve PFR/Properties coverage #143
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.
This PR significantly expands and modernizes FreeType's fuzzing infrastructure, closing several documented coverage gaps and ensuring robust deployment on OSS-Fuzz.
Key Enhancements:
Structure-Aware Cache Fuzzer:
CacheFuzzTargetfrom a static fuzzer into a bytecode interpreter.FTC_ManagerAPI (Reset, Lookup, Resize, RemoveID, Unref), enabling the exploration of complex state machine transitions.Dedicated Properties Fuzzer:
PropertiesFuzzTargetandFaceVisitorPropertiesto specifically stress theFT_Face_PropertiesAPI.Enhanced PFR Driver Coverage:
FaceVisitorPfrto test a robust range of glyph indices (including intentionally invalid/OOB values) and kerning pairs, moving beyond the previous static check of the first 20 glyphs.Full Multi-Sanitizer Infrastructure (ASan/MSan/UBSan):
zlib.sh,libpng.sh,freetype.sh) to support MemorySanitizer and standalone UBSan.get_lib_suffix.sh) that intelligently switches betweenlib-asan,lib-msan, andlib-ubsanbased onCFLAGS.Full Deployment & CI Integration:
prepare-oss-fuzz.shto include thecache,pfr, andpropertiestargets in the deployment harvest.corporaglobbing logic.Official Documentation Update:
README.mdto reflect the new API coverage, officially marking Cache, PFR, and Properties as fuzzed.Quality-of-Life Assets:
pfr.dict,pfr.options,cache.options, andproperties.optionsto guide the fuzzing engine on the cluster.All changes have been verified locally using
clangwith AddressSanitizer, UBSan, and Coverage instrumentation.