Sergey Bronnikov 2023-05-30 02:30:19 +03:00 committed by GitHub
parent 79e586a2e7
commit 90c1170af5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 124 additions and 0 deletions

View File

@ -0,0 +1,27 @@
# 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
RUN apt-get update && apt-get install -y \
build-essential git-core cmake ninja-build pkg-config zlib1g-dev \
libx11-dev libxext-dev libxinerama-dev libxcursor-dev libxkbfile-dev \
libxv-dev libxi-dev libxdamage-dev libxrender-dev libxrandr-dev \
libssl-dev libasound2-dev libcups2-dev libpulse-dev libcairo2-dev \
libavutil-dev libavcodec-dev libusb-1.0-0-dev libicu-dev
RUN git clone --depth 1 https://github.com/FreeRDP/FreeRDP.git
WORKDIR FreeRDP
COPY build.sh $SRC/

80
projects/freerdp/build.sh Executable file
View File

@ -0,0 +1,80 @@
#!/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.
#
################################################################################
# Avoid compilation issue due to some undefined references. They are defined in
# libc++ and used by Centipede so -lc++ needs to come after centipede's lib.
if [[ $FUZZING_ENGINE == centipede ]]
then
sed -i \
'/$ENV{LIB_FUZZING_ENGINE}/a \ \ \ \ \ \ \ \ -lc++' \
cmake/ConfigOptions.cmake
fi
case $SANITIZER in
address) SANITIZERS_ARGS="-DWITH_SANITIZE_ADDRESS=ON" ;;
memory) SANITIZERS_ARGS="-DWITH_SANITIZE_MEMORY=ON" ;;
*) SANITIZERS_ARGS="" ;;
esac
: ${LD:="${CXX}"}
: ${LDFLAGS:="${CXXFLAGS}"} # to make sure we link with sanitizer runtime
cmake_args=(
# Specific to FreeRDP.
-DWITH_CLIENT_CHANNELS=OFF # Disable libusb.
-DWITH_FFMPEG=OFF
-DWITH_WAYLAND=OFF
-DWITH_ALSA=OFF
-DWITH_X11=OFF
-DWITH_LIBSYSTEMD=OFF
-DWITH_PCSC=OFF
-DWITH_GSTREAMER_0_10=OFF
-DWITH_GSTREAMER_1_0=OFF
-DWITH_KRB5=OFF
-DWITH_FUSE=OFF
$SANITIZERS_ARGS
-DCMAKE_BUILD_TYPE=Debug
-DBUILD_SHARED_LIBS=OFF
-DOSS_FUZZ=ON
-DBUILD_FUZZERS=ON
# C compiler
-DCMAKE_C_COMPILER="${CC}"
-DCMAKE_C_FLAGS="${CFLAGS}"
# C++ compiler
-DCMAKE_CXX_COMPILER="${CXX}"
-DCMAKE_CXX_FLAGS="${CXXFLAGS}"
# Linker
-DCMAKE_LINKER="${LD}"
-DCMAKE_EXE_LINKER_FLAGS="${LDFLAGS}"
-DCMAKE_MODULE_LINKER_FLAGS="${LDFLAGS}"
-DCMAKE_SHARED_LINKER_FLAGS="${LDFLAGS}"
)
# Build the project and fuzzers.
rm -rf build
cmake "${cmake_args[@]}" -S . -B build -G Ninja
cmake --build build --parallel --target TestFuzzCryptoCertificateDataSetPEM
for f in $(find build/Testing/ -name 'TestFuzz*' -type f);
do
cp $f $OUT/
done

View File

@ -0,0 +1,17 @@
homepage: "https://www.freerdp.com/"
main_repo: "https://github.com/FreeRDP/FreeRDP"
language: c
primary_contact: "team@freerdp.com"
auto_ccs:
- "estetus@gmail.com"
builds_per_day: 4
fuzzing_engines:
- afl
- centipede
- honggfuzz
- libfuzzer
sanitizers:
- address
- memory
architectures:
- x86_64