[hermes] Add JS dictionary to improve fuzzing efficiency (#9456)

Currently, the Hermes setup does not use [a dictionary to help mutate
input](https://google.github.io/oss-fuzz/getting-started/new-project-guide/#dictionaries).
This PR adds JS dictionaries and edits the fuzzing setup to use
`hermes.dict` during fuzzing.
This commit is contained in:
0xedward 2023-01-19 19:44:53 -05:00 committed by GitHub
parent aec5de2b44
commit 5a9e2a461b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 11 additions and 0 deletions

View File

@ -19,9 +19,17 @@ RUN apt-get update && \
apt-get install -y make autoconf automake libtool wget \
python zip libreadline-dev libatomic-ops-dev
# Building ninja requires PEP 517
RUN pip3 install "pip>=22.3.1"
RUN pip3 install meson ninja
RUN ln -s /usr/local/bin/ninja /usr/bin/ninja
# Add JS dictionaries
RUN git clone --depth 1 https://github.com/chromium/chromium && \
cat chromium/testing/libfuzzer/fuzzers/dicts/javascript_parser_proto.dict > $SRC/hermes.dict && \
cat chromium/testing/libfuzzer/fuzzers/dicts/generated/javascript.dict >> $SRC/hermes.dict
RUN wget https://github.com/unicode-org/icu/archive/refs/tags/cldr/2021-08-25.tar.gz && \
tar xzvf ./2021-08-25.tar.gz && \
mv ./icu-cldr-2021-08-25/icu4c $SRC/icu

View File

@ -18,6 +18,9 @@
# Copy seed corpora
mv $SRC/hermes_seed_corpus.zip $OUT
# Copy dictionary file
mv $SRC/hermes.dict $OUT
# build ICU for linking statically.
cd $SRC/icu/source
./configure --disable-shared --enable-static --disable-layoutex \