Skip to content

Commit

Permalink
dill: initial integration (#9684)
Browse files Browse the repository at this point in the history
Signed-off-by: David Korczynski <david@adalogics.com>

Signed-off-by: David Korczynski <david@adalogics.com>
  • Loading branch information
DavidKorczynski authored Feb 11, 2023
1 parent d7b7a1f commit e52f913
Show file tree
Hide file tree
Showing 4 changed files with 87 additions and 0 deletions.
19 changes: 19 additions & 0 deletions projects/dill/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
#!/usr/bin/python3
# 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-python
RUN pip3 install --upgrade pip
RUN git clone https://github.com/uqfoundation/dill dill
COPY *.sh *py $SRC/
WORKDIR $SRC/dill
21 changes: 21 additions & 0 deletions projects/dill/build.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
#!/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.
#
################################################################################
pip3 install .
# Build fuzzers in $OUT.
for fuzzer in $(find $SRC -name 'fuzz_*.py'); do
compile_python_fuzzer $fuzzer
done
37 changes: 37 additions & 0 deletions projects/dill/fuzz_dumps.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
#!/usr/bin/python3
# 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.
import sys
import atheris

from dill import dumps, loads


def TestOneInput(data):
# Anything loadable should be dumpable
try:
dilled = loads(data)
except:
return
dumps(dilled)


def main():
atheris.instrument_all()
atheris.Setup(sys.argv, TestOneInput)
atheris.Fuzz()


if __name__ == "__main__":
main()
10 changes: 10 additions & 0 deletions projects/dill/project.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
homepage: https://github.com/uqfoundation/dill
main_repo: https://github.com/uqfoundation/dill
language: python
fuzzing_engines:
- libfuzzer
sanitizers:
- address
- undefined
vendor_ccs:
- david@adalogics.com

0 comments on commit e52f913

Please sign in to comment.