-
Notifications
You must be signed in to change notification settings - Fork 2.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: Taras Drozdovskyi <[email protected]>
- Loading branch information
1 parent
f653806
commit 853689b
Showing
3 changed files
with
86 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
FROM gcr.io/oss-fuzz-base/base-builder-jvm | ||
|
||
RUN curl -L https://archive.apache.org/dist/maven/maven-3/3.9.6/binaries/apache-maven-3.9.6-bin.zip -o maven.zip && \ | ||
unzip maven.zip -d $SRC/maven && \ | ||
rm -rf maven.zip | ||
|
||
ENV MVN $SRC/maven/apache-maven-3.9.6/bin/mvn | ||
|
||
RUN git clone --depth 1 https://github.com/samsung/lpvs | ||
|
||
COPY . $SRC | ||
|
||
# WORKDIR | ||
WORKDIR $SRC/ | ||
|
||
#COPY build.sh $SRC/ | ||
COPY build.sh $SRC/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,59 @@ | ||
#!/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. | ||
# | ||
################################################################################ | ||
|
||
PROJECT=lpvs | ||
PROJECT_GROUP_ID=com.lpvs | ||
PROJECT_ARTIFACT_ID=lpvs | ||
MAIN_REPOSITORY=https://github.com/samsung/lpvs | ||
MAVEN_ARGS="-Djavac.src.version=17 -Djavac.target.version=17 -Denforcer.skip=true -DskipTests -Dgpg.skip" | ||
|
||
# Move seed corpus and dictionary. | ||
# mv $SRC/{*.zip,*.dict} $OUT | ||
|
||
#install | ||
# ($MVN install $MAVEN_ARGS -Dmaven.repo.local=$OUT/m2) | ||
(cd $PROJECT && $MVN install $MAVEN_ARGS -Dmaven.repo.local=$OUT/m2) | ||
|
||
# build classpath | ||
$MVN dependency:build-classpath -DskipTests -Dmdep.outputFile=cp.txt -Dmaven.repo.local=$OUT/m2 | ||
|
||
cp -r $SRC/lpvs/target/test-classes/ $OUT/ | ||
cp -r $SRC/lpvs/target/classes/ $OUT/ | ||
RUNTIME_CLASSPATH_ABSOLUTE="$(cat cp.txt):$OUT/test-classes:$OUT/classes" | ||
RUNTIME_CLASSPATH=$(echo $RUNTIME_CLASSPATH_ABSOLUTE | sed "s|$OUT|\$this_dir|g") | ||
|
||
for fuzzer in $(find $SRC -name '*Fuzzer.java'); do | ||
fuzzer_basename=$(basename -s .java $fuzzer) | ||
|
||
# Create an execution wrapper for every fuzztarget | ||
echo "#!/bin/bash | ||
# LLVMFuzzerTestOneInput comment for fuzzer detection by infrastructure. | ||
this_dir=\$(dirname \"\$0\") | ||
if [[ \"\$@\" =~ (^| )-runs=[0-9]+($| ) ]]; then | ||
mem_settings='-Xmx1900m:-Xss900k' | ||
else | ||
mem_settings='-Xmx2048m:-Xss1024k' | ||
fi | ||
LD_LIBRARY_PATH=\"$JVM_LD_LIBRARY_PATH\":\$this_dir \ | ||
\$this_dir/jazzer_driver --agent_path=\$this_dir/jazzer_agent_deploy.jar \ | ||
--cp=$RUNTIME_CLASSPATH \ | ||
--target_class=com.lpvs.util.$fuzzer_basename \ | ||
--jvm_args=\"\$mem_settings\" \ | ||
--instrumentation_includes=\"com.**:org.**\" \ | ||
\$@" > $OUT/$fuzzer_basename | ||
chmod u+x $OUT/$fuzzer_basename | ||
done |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
homepage: "https://samsung.github.io/LPVS/" | ||
language: jvm | ||
fuzzing_engines: | ||
- libfuzzer | ||
main_repo: "https://github.com/samsung/lpvs" | ||
sanitizers: | ||
- address | ||
vendor_ccs: | ||
- "[email protected]" | ||
- "[email protected]" |