New project: crosvm (#10284)

crosvm fuzzing is currently running as part of ChromeOS infra, where the
project originated.

Crosvm has since become an independent project with separate
infrastructure and we would like to move fuzzing out of ChromeOS as
well.

Tested with `python3 infra/helper.py check_build crosvm`

---------

Co-authored-by: jonathanmetzman <31354670+jonathanmetzman@users.noreply.github.com>
This commit is contained in:
Dennis Kempin 2023-05-12 13:31:45 -07:00 committed by GitHub
parent 8a26e56cd7
commit 91aaa43e4e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 69 additions and 0 deletions

View File

@ -0,0 +1,26 @@
# Copyright 2023 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 --recursive https://chromium.googlesource.com/crosvm/crosvm $SRC/crosvm
RUN apt-get upgrade && apt-get install --yes --no-install-recommends \
libclang-dev \
pkg-config \
libcap-dev
COPY build.sh $SRC

33
projects/crosvm/build.sh Executable file
View File

@ -0,0 +1,33 @@
#!/bin/bash -eu
# Copyright 2023 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 crosvm
# Build crosvm fuzzers
# Unset the SRC variable as it will interfere with minijail's common.mk framework.
env -u SRC cargo +nightly \
fuzz build \
-O \
--fuzz-dir=crosvm-fuzz \
--features upstream-fuzz
# Copy fuzzer binaries to $OUT
FUZZ_TARGET_OUTPUT_DIR="target/x86_64-unknown-linux-gnu/release"
for f in crosvm-fuzz/*.rs; do
FUZZ_TARGET_NAME=$(basename ${f%.*})
cp "${FUZZ_TARGET_OUTPUT_DIR}/crosvm_${FUZZ_TARGET_NAME}" "$OUT/"
done

View File

@ -0,0 +1,10 @@
homepage: "http://crosvm.dev"
language: rust
primary_contact: "denniskempin@google.com"
auto_ccs:
- "crosvm-core@google.com"
main_repo: "https://chromium.googlesource.com/crosvm/crosvm"
sanitizers:
- address
fuzzing_engines:
- libfuzzer