]> git.ipfire.org Git - thirdparty/suricata.git/commitdiff
ci: update ubuntu22.04 builds with clang14+asan
authorJason Ish <jason.ish@oisf.net>
Mon, 18 Mar 2024 17:54:20 +0000 (11:54 -0600)
committerVictor Julien <vjulien@oisf.net>
Tue, 19 Mar 2024 09:25:05 +0000 (10:25 +0100)
using a workround about ASLR

Backport of 632e52ca2b72f8a3462b22896cb5d25d9d724f9c but not a cherry
pick.

.github/workflows/builds.yml

index 18fb4a4d41be785a3a0941adc550c622743828a2..98bdea03b3c5770c3127b79e473551c0606cde56 100644 (file)
@@ -1114,7 +1114,9 @@ jobs:
   ubuntu-22-04-fuzz:
     name: Ubuntu 22.04 (Fuzz)
     runs-on: ubuntu-22.04
-    container: ubuntu:22.04
+    container:
+      image: ubuntu:22.04
+      options: --privileged
     needs: [prepare-deps, prepare-cbindgen]
     steps:
 
@@ -1157,6 +1159,7 @@ jobs:
                 make \
                 rustc \
                 software-properties-common \
+                sudo \
                 zlib1g \
                 zlib1g-dev
       - run: echo "$HOME/.cargo/bin" >> $GITHUB_PATH
@@ -1171,7 +1174,13 @@ jobs:
           mkdir -p $HOME/.cargo/bin
           cp prep/cbindgen $HOME/.cargo/bin
           chmod 755 $HOME/.cargo/bin/cbindgen
-          echo "$HOME/.cargo/bin" >> $GITHUB_PATH      - run: tar xf prep/libhtp.tar.gz
+          echo "$HOME/.cargo/bin" >> $GITHUB_PATH
+      - run: tar xf prep/libhtp.tar.gz
+      - name: Fix kernel mmap rnd bits
+      # Asan in llvm 14 provided in ubuntu 22.04 is incompatible with
+      # high-entropy ASLR in much newer kernels that GitHub runners are
+      # using leading to random crashes: https://github.com/actions/runner-images/issues/9491
+        run: sudo sysctl vm.mmap_rnd_bits=28
       - run: ./autogen.sh
       - run: AFL_HARDEN=1 ac_cv_func_realloc_0_nonnull=yes ac_cv_func_malloc_0_nonnull=yes CFLAGS="-fsanitize=address -fno-omit-frame-pointer" CXXFLAGS=$CFLAGS CC=afl-clang-fast CXX=afl-clang-fast++ ./configure --enable-fuzztargets --disable-shared
       - run: AFL_HARDEN=1 make -j2