Submit itoa and ryu. (#7928)

* Submit itoa and ryu.

These two libraries are used by serde_json which, in turn, is used as the
standard JSON parser in various higher level projects. Both itoa and ryu
contain unsafe code, which this fuzzes.

* Update project.yaml

* Update project.yaml

* Update Dockerfile

* Update Dockerfile

* Rejigging ryu/itoa Dockerfiles.

Previously I was following the example of image-png, but that appears not to be
the modern standard. Now following the example of zip-rs instead.

* Fix Dockerfile error

* Further Dockerfile fix.

Co-authored-by: jonathanmetzman <31354670+jonathanmetzman@users.noreply.github.com>
This commit is contained in:
Adrian Taylor 2022-06-30 18:38:42 -07:00 committed by GitHub
parent 454a645eed
commit 36a6c45c52
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
6 changed files with 106 additions and 0 deletions

22
projects/itoa/Dockerfile Normal file
View File

@ -0,0 +1,22 @@
# Copyright 2022 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
################################################################################
FROM gcr.io/oss-fuzz-base/base-builder-rust
RUN git clone --depth 1 https://github.com/dtolnay/itoa
WORKDIR $SRC
COPY build.sh $SRC/

21
projects/itoa/build.sh Executable file
View File

@ -0,0 +1,21 @@
#!/bin/bash -eu
# Copyright 2022 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
################################################################################
cd $SRC
cd itoa
cargo fuzz build -O
cp fuzz/target/x86_64-unknown-linux-gnu/release/fuzz_itoa $OUT/

View File

@ -0,0 +1,10 @@
homepage: "https://github.com/dtolnay/itoa"
primary_contact: "dtolnay@gmail.com"
main_repo: "https://github.com/dtolnay/itoa"
sanitizers:
- address
fuzzing_engines:
- libfuzzer
language: rust
auto_ccs:
- "adetaylor@chromium.org"

22
projects/ryu/Dockerfile Normal file
View File

@ -0,0 +1,22 @@
# Copyright 2022 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
################################################################################
FROM gcr.io/oss-fuzz-base/base-builder-rust
RUN git clone --depth 1 https://github.com/dtolnay/ryu
WORKDIR $SRC
COPY build.sh $SRC/

21
projects/ryu/build.sh Executable file
View File

@ -0,0 +1,21 @@
#!/bin/bash -eu
# Copyright 2022 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
################################################################################
cd $SRC
cd ryu
cargo fuzz build -O
cp fuzz/target/x86_64-unknown-linux-gnu/release/fuzz_ryu $OUT/

10
projects/ryu/project.yaml Normal file
View File

@ -0,0 +1,10 @@
homepage: "https://github.com/dtolnay/ryu"
main_repo: "https://github.com/dtolnay/ryu"
primary_contact: "dtolnay@gmail.com"
sanitizers:
- address
fuzzing_engines:
- libfuzzer
language: rust
auto_ccs:
- "adetaylor@chromium.org"