Home | History | Annotate | Download | only in apache-httpd
      1 diff --git a/configure.in b/configure.in
      2 index b20aad0..eec5ba2 100644
      3 --- a/configure.in
      4 +++ b/configure.in
      5 @@ -725,7 +725,7 @@ AC_MSG_CHECKING([for Check to enable unit tests])
      6  if test "x$PKGCONFIG" != "x" && `$PKGCONFIG --atleast-version='0.9.12' check`; then
      7    UNITTEST_CFLAGS=`$PKGCONFIG --cflags check`
      8    UNITTEST_LIBS=`$PKGCONFIG --libs check`
      9 -  other_targets="$other_targets test/httpdunit"
     10 +  other_targets="$other_targets"
     11  
     12    AC_MSG_RESULT([yes])
     13  else
     14 diff --git a/hfuzz.compile_and_install.asan.sh b/hfuzz.compile_and_install.asan.sh
     15 new file mode 100755
     16 index 0000000..f8a9a41
     17 --- /dev/null
     18 +++ b/hfuzz.compile_and_install.asan.sh
     19 @@ -0,0 +1,63 @@
     20 +#!/bin/sh
     21 +
     22 +set -ex
     23 +
     24 +# Directory with honggfuzz installation
     25 +HFUZZ_DIR="/home/jagger/src/honggfuzz"
     26 +# Change this to a directory where apache should be installed into
     27 +INSTALL_PREFIX="$(realpath "$PWD/../dist")"
     28 +NGHTTP2_VER=1.33.0
     29 +APR_VER=1.6.5
     30 +APR_UTIL_VER=1.6.1
     31 +CFLAGS_SAN="-fsanitize=address -O3 -ggdb"
     32 +# Another viable option: few
     33 +APACHE_MODULES=most
     34 +
     35 +NGHTTP2_PATH="$(realpath "$PWD/../nghttp2-$NGHTTP2_VER")/"
     36 +APR_PATH="$(realpath "$PWD/../apr-$APR_VER")"
     37 +APR_UTIL_PATH="$(realpath "$PWD/../apr-util-$APR_UTIL_VER")/"
     38 +
     39 +export CC="$HFUZZ_DIR/hfuzz_cc/hfuzz-clang"
     40 +export CXX="$HFUZZ_DIR/hfuzz_cc/hfuzz-clang++"
     41 +
     42 +echo "Compiling APR"
     43 +cd "$APR_PATH"
     44 +CFLAGS="$CFLAGS_SAN" ./configure --disable-shared --enable-static
     45 +make clean
     46 +make -j$(nproc)
     47 +cd -
     48 +
     49 +echo "Compiling APR-UTIL"
     50 +cd "$APR_UTIL_PATH"
     51 +CFLAGS="$CFLAGS_SAN" ./configure --with-apr="$APR_PATH" --disable-shared --enable-static
     52 +make clean
     53 +make -j$(nproc)
     54 +cd -
     55 +
     56 +echo "Compiling NGHTTP2"
     57 +cd "$NGHTTP2_PATH"
     58 +CFLAGS="$CFLAGS_SAN" CXXFLAGS="$CFLAGS_SAN" ./configure --disable-shared --enable-static
     59 +make clean
     60 +make -j$(nproc)
     61 +cd -
     62 +
     63 +echo "Install PATH: $INSTALL_PREFIX"
     64 +./buildconf --with-apr="$APR_PATH" --with-apr-util="$APR_UTIL_PATH"
     65 +
     66 +echo "Compiling HTTPD"
     67 +CFLAGS="-I$NGHTTP2_PATH/lib/includes $CFLAGS_SAN -ggdb -O3" LDFLAGS="-L$NGHTTP2_PATH/lib -lpthread" \
     68 +./configure \
     69 +		--prefix="$INSTALL_PREFIX" \
     70 +		--with-nghttp2="$NGHTTP2_PATH/" \
     71 +		--enable-http2 \
     72 +		--enable-nghttp2-staticlib-deps \
     73 +		--with-mpm=event \
     74 +		--enable-unixd \
     75 +		--disable-pie \
     76 +		--disable-ssl \
     77 +		--enable-mods-static=$APACHE_MODULES \
     78 +		--with-apr="$APR_PATH" \
     79 +		--with-apr-util="$APR_UTIL_PATH"
     80 +make clean
     81 +make -j$(nproc)
     82 +make install
     83 diff --git a/modules/generators/mod_autoindex.c b/modules/generators/mod_autoindex.c
     84 index c887056..1be2d16 100644
     85 --- a/modules/generators/mod_autoindex.c
     86 +++ b/modules/generators/mod_autoindex.c
     87 @@ -1907,6 +1907,8 @@ static void output_directories(struct ent **ar, int n,
     88  
     89  static int dsortf(struct ent **e1, struct ent **e2)
     90  {
     91 +    return 0;
     92 +
     93      struct ent *c1;
     94      struct ent *c2;
     95      int result = 0;
     96 diff --git a/server/request.c b/server/request.c
     97 index 70812fe..b62272e 100644
     98 --- a/server/request.c
     99 +++ b/server/request.c
    100 @@ -1393,7 +1393,7 @@ AP_DECLARE(int) ap_directory_walk(request_rec *r)
    101      return OK;
    102  }
    103  
    104 -
    105 +__attribute__((no_sanitize("memory")))
    106  AP_DECLARE(int) ap_location_walk(request_rec *r)
    107  {
    108      ap_conf_vector_t *now_merged = NULL;
    109 diff --git a/server/util_pcre.c b/server/util_pcre.c
    110 index 8254cc4..ef70c43 100644
    111 --- a/server/util_pcre.c
    112 +++ b/server/util_pcre.c
    113 @@ -388,6 +388,7 @@ AP_DECLARE(int) ap_regexec_len(const ap_regex_t *preg, const char *buff,
    114      }
    115  }
    116  
    117 +__attribute__((no_sanitize("memory")))
    118  AP_DECLARE(int) ap_regname(const ap_regex_t *preg,
    119                             apr_array_header_t *names, const char *prefix,
    120                             int upper)
    121