From 3f26278199b733b5506651d2c8f76c70ed26b882 Mon Sep 17 00:00:00 2001 From: Ilya Maximets Date: Tue, 12 Mar 2024 12:47:49 +0100 Subject: [PATCH] github: Reduce ASLR entropy to be compatible with asan in llvm 14. Starting with image version 20240310.1.0, GitHub runners are using 32-bit entropy for ASLR: $ sudo sysctl -a | grep vm.mmap.rnd vm.mmap_rnd_bits = 32 vm.mmap_rnd_compat_bits = 16 This breaks all the asan-enabled builds, because older asan gets confused by memory mappings and crashes with segmentation fault. The issue is fixed in newer releases of llvm: https://github.com/llvm/llvm-project/commit/fb77ca05ffb4f8e666878f2f6718a9fb4d686839 https://reviews.llvm.org/D148280 But these are not available in Ubuntu 22.04 image. This should be fixed by GitHub, but until new images are available reducing ASLR entropy manually to 28 bits to make builds work. Reported-at: https://github.com/actions/runner-images/issues/9491 Signed-off-by: Ilya Maximets Acked-by: Eelco Chaudron Acked-by: Aaron Conole Signed-off-by: Dumitru Ceara (cherry picked from OVS commit bb7dfa652218f36768128c00664ee7cc146baea9) --- .github/workflows/test.yml | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 0cb9817754..5c9d35ac0a 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -225,6 +225,14 @@ jobs: sudo chmod +x /usr/bin/crun echo "New crun version: "$(crun --version) + - name: Reduce ASLR entropy + if: matrix.sanitizers != '' + # Asan in llvm 14 provided in ubuntu-22.04 is incompatible with + # high-entropy ASLR configured in much newer kernels that GitHub + # runners are using leading to random crashes: + # https://github.com/actions/runner-images/issues/9491 + run: sudo sysctl -w vm.mmap_rnd_bits=28 + - name: load image run: | sudo podman load -i /tmp/image.tar