Skip to content

Add a dictionary for the execute and JIT fuzzers - #24726

Open
yumasansansan wants to merge 1 commit into
php:masterfrom
yumasansansan:fuzzer-execute-dict
Open

yumasansansan wants to merge 1 commit into
php:masterfrom
yumasansansan:fuzzer-execute-dict

Conversation

@yumasansansan

Copy link
Copy Markdown
Contributor

php-fuzz-execute, php-fuzz-function-jit and php-fuzz-tracing-jit run without a dictionary on OSS-Fuzz. Function and class names are resolved through hash table lookups, so libFuzzer's comparison tracing does not help to discover them, and reaching an internal function requires guessing its name.

generate_execute_dict.php (called from generate_all.php) writes dict/execute: the keywords from dict/parser plus all internal functions, classes and interfaces of the build (1111 entries with --disable-all --enable-exif --enable-mbstring --enable-session), escaped for libFuzzer. libFuzzer accepts the file (Dictionary: 1111 entries).

The README also referred to php-fuzzer-function-jit; the binary is php-fuzz-function-jit.

For OSS-Fuzz to use the dictionary, projects/php/build.sh in google/oss-fuzz has to copy it to $OUT/php-fuzz-execute.dict (and likewise for the JIT fuzzers). That change will be submitted to google/oss-fuzz separately.

Internal functions and classes are looked up through hash tables, so
the fuzzer cannot learn their names from comparisons. Generate a
dictionary of internal functions, classes and interfaces, combined with
the keywords of the parser dictionary. Also fix the fuzzer name in the
README.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant