diff options
author | Benjamin Barenblat <bbarenblat@gmail.com> | 2022-07-12 05:11:56 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-07-12 10:11:56 +0100 |
commit | f44e7b364a1cab3f7cd4063bb9be11ee952b7956 (patch) | |
tree | 72fee537cd40b6060d797040b206b90d1e46d9ab | |
parent | 259f3e87d79ce7405fae31b83d61622f50249b60 (diff) |
mosh: enable fuzzers (#7995)
-rw-r--r-- | projects/mosh/Dockerfile | 22 | ||||
-rwxr-xr-x | projects/mosh/build.sh | 40 | ||||
-rw-r--r-- | projects/mosh/project.yaml | 8 |
3 files changed, 70 insertions, 0 deletions
diff --git a/projects/mosh/Dockerfile b/projects/mosh/Dockerfile new file mode 100644 index 00000000..c3497e91 --- /dev/null +++ b/projects/mosh/Dockerfile @@ -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 +RUN apt-get update && apt-get install -y autoconf automake protobuf-compiler \ + libprotobuf-dev pkg-config zlib1g-dev libncurses5-dev libssl-dev clang +RUN git clone --depth 1 https://github.com/mobile-shell/mosh.git +WORKDIR mosh +COPY build.sh $SRC/ diff --git a/projects/mosh/build.sh b/projects/mosh/build.sh new file mode 100755 index 00000000..87526a18 --- /dev/null +++ b/projects/mosh/build.sh @@ -0,0 +1,40 @@ +#!/bin/sh +# 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. +# +################################################################################ + +set -eu + +./autogen.sh + +# Clear CFLAGS and CXXFLAGS during configure tests so configure won't try to +# link with -fsanitize=fuzz. +CFLAGS= CXXFLAGS= ./configure --enable-fuzzing --enable-asan --enable-static-libraries + +n=$(nproc) +make -j$n + +cd src/fuzz + +make -j$n + +for fuzzer in *_fuzzer; do + cp $fuzzer $OUT + + corpus=${fuzzer%_fuzzer}_corpus + if [ -d $corpus ]; then + zip -j $OUT/${fuzzer}_seed_corpus.zip $corpus/* + fi +done diff --git a/projects/mosh/project.yaml b/projects/mosh/project.yaml index 9a4d78d0..0713f634 100644 --- a/projects/mosh/project.yaml +++ b/projects/mosh/project.yaml @@ -4,4 +4,12 @@ auto_ccs: - "cgull@glup.org" - "andersk@mit.edu" - "achernya@google.com" + - "bbaren@google.com" - "mosh-security@mit.edu" +language: c++ +main_repo: "https://github.com/mobile-shell/mosh.git" +file_github_issue: true +sanitizers: + - address +fuzzing_engines: + - libfuzzer |