[SCM] Samba Shared Repository - branch master updated

Andrew Bartlett abartlet at samba.org
Wed Oct 21 03:48:04 UTC 2020


The branch, master has been updated
       via  9dfeb81d08c fuzz/oss-fuzz/build_samba: fetch fuzz seeds
       via  6d388da765e fuzz/oss-fuzz/build-samba: note the calling site
       via  be51499f7de fuzzing/README: link to wiki
      from  e246976b676 s3:tests: Add tests for 'valid users'.

https://git.samba.org/?p=samba.git;a=shortlog;h=master


- Log -----------------------------------------------------------------
commit 9dfeb81d08cd5883c9dc1aaecaf0ce03f2812efc
Author: Douglas Bagnall <douglas.bagnall at catalyst.net.nz>
Date:   Thu Oct 15 14:34:04 2020 +1300

    fuzz/oss-fuzz/build_samba: fetch fuzz seeds
    
    There is a git repository at
    https://gitlab.com/samba-team/samba-fuzz-seeds that contains the
    seeds. When the master branch of that repository is updated, a CI job
    runs that creates a zip file of all the seeds as an artifact. That zip
    file is downloaded and unpacked by oss_fuzz/build_samba. The contents
    of that zip are further zips that contain the seeds for each fuzzing
    binary; these are placed next to the binaries in the manner that
    oss-fuzz expects.
    
    That is, beside 'fuzz_foo', we put 'fuzz_foo_seed_corpus.zip' which
    contains a pile of fuzz_foo seeds.
    
    There may be times when a new fuzz target does not have a seed corpus,
    and times when a removed fuzz target leaves behind a seed corpus.
    This is OK, so we don't insist on an exact match between the target
    names and the zip names, only that there is some overlap.
    
    Signed-off-by: Douglas Bagnall <douglas.bagnall at catalyst.net.nz>
    Reviewed-by: Andrew Bartlett <abartlet at samba.org>
    
    Autobuild-User(master): Andrew Bartlett <abartlet at samba.org>
    Autobuild-Date(master): Wed Oct 21 03:47:35 UTC 2020 on sn-devel-184

commit 6d388da765e0ac1df3e5ba1eab055558838497e6
Author: Douglas Bagnall <douglas.bagnall at catalyst.net.nz>
Date:   Thu Oct 15 14:31:15 2020 +1300

    fuzz/oss-fuzz/build-samba: note the calling site
    
    Signed-off-by: Douglas Bagnall <douglas.bagnall at catalyst.net.nz>
    Reviewed-by: Andrew Bartlett <abartlet at samba.org>

commit be51499f7deb4551e2a81f77582f3828d6652681
Author: Douglas Bagnall <douglas.bagnall at catalyst.net.nz>
Date:   Thu Oct 15 14:07:10 2020 +1300

    fuzzing/README: link to wiki
    
    Signed-off-by: Douglas Bagnall <douglas.bagnall at catalyst.net.nz>
    Reviewed-by: Andrew Bartlett <abartlet at samba.org>

-----------------------------------------------------------------------

Summary of changes:
 lib/fuzzing/README.md               |  4 +++-
 lib/fuzzing/oss-fuzz/build_samba.sh | 18 +++++++++++++++++-
 lib/fuzzing/oss-fuzz/check_build.sh | 16 ++++++++++++++++
 3 files changed, 36 insertions(+), 2 deletions(-)


Changeset truncated at 500 lines:

diff --git a/lib/fuzzing/README.md b/lib/fuzzing/README.md
index 5a248241248..33d33b92390 100644
--- a/lib/fuzzing/README.md
+++ b/lib/fuzzing/README.md
@@ -1,5 +1,7 @@
 # Fuzzing Samba
 
+See also https://wiki.samba.org/index.php/Fuzzing
+
 Fuzzing supplies valid, invalid, unexpected or random data as input to a piece
 of code. Instrumentation, usually compiler-implemented, is used to monitor for
 exceptions such as crashes, assertions or memory corruption.
@@ -7,7 +9,7 @@ exceptions such as crashes, assertions or memory corruption.
 See [Wikipedia article on fuzzing](https://en.wikipedia.org/wiki/Fuzzing) for
 more information.
 
-# Hongfuzz
+# Honggfuzz
 
 ## Configure with fuzzing
 
diff --git a/lib/fuzzing/oss-fuzz/build_samba.sh b/lib/fuzzing/oss-fuzz/build_samba.sh
index b06e03c4903..b27c7b7d5c8 100755
--- a/lib/fuzzing/oss-fuzz/build_samba.sh
+++ b/lib/fuzzing/oss-fuzz/build_samba.sh
@@ -1,11 +1,16 @@
 #!/bin/sh
 #
-# This is not a general-purpose build script, but instead one specific to the Google oss-fuzz compile environment.
+# This is not a general-purpose build script, but instead one specific
+# to the Google oss-fuzz compile environment.
 #
 # https://google.github.io/oss-fuzz/getting-started/new-project-guide/#Requirements
 #
 # https://github.com/google/oss-fuzz/blob/master/infra/base-images/base-builder/README.md#provided-environment-variables
 #
+# This file is run by
+# https://github.com/google/oss-fuzz/blob/master/projects/samba/build.sh
+# which does nothing else.
+#
 # We have to push to oss-fuzz CFLAGS into the waf ADDITIONAL_CFLAGS
 # as otherwise waf's configure fails linking the first test binary
 #
@@ -105,4 +110,15 @@ do
 
     # Truncate the original binary to save space
     echo -n > $x
+
 done
+
+# Grap the seeds dictionary from github and put the seed zips in place
+# beside their executables.
+
+wget https://gitlab.com/samba-team/samba-fuzz-seeds/-/jobs/artifacts/master/download?job=zips \
+     -O seeds.zip
+
+# We might not have unzip, but we do have python
+$PYTHON -mzipfile -e seeds.zip  $OUT
+rm -f seeds.zip
diff --git a/lib/fuzzing/oss-fuzz/check_build.sh b/lib/fuzzing/oss-fuzz/check_build.sh
index cc69cf26418..b971d2c1bb0 100755
--- a/lib/fuzzing/oss-fuzz/check_build.sh
+++ b/lib/fuzzing/oss-fuzz/check_build.sh
@@ -13,8 +13,15 @@ OUT=$1
 
 # build_samba.sh will have put a non-zero number of fuzzers here.  If
 # there are none, this will fail as it becomes literally fuzz_*
+
+seeds_found=no
+
 for bin in $OUT/fuzz_*
 do
+    # we only want to look at the elf files, not the zips
+    if [ ${bin%_seed_corpus.zip} != $bin ]; then
+        continue
+    fi
     # Confirm that the chrpath was reset to lib/ in the same directory
     # as the binary
     chrpath -l $bin | grep 'RUNPATH=$ORIGIN/lib'
@@ -22,4 +29,13 @@ do
     # Confirm that we link to at least some libraries in this
     # directory (shows that the libraries were found and copied).
     ldd $bin | grep "$OUT/lib"
+
+    if [ -f ${bin}_seed_corpus.zip ]; then
+        seeds_found=yes
+    fi
 done
+
+if [ $seeds_found = no ]; then
+    echo "no seed zip files were found!"
+    exit 1
+fi


-- 
Samba Shared Repository



More information about the samba-cvs mailing list