Skip to content

Commit

Permalink
github: Reduce ASLR entropy to be compatible with asan in llvm 14.
Browse files Browse the repository at this point in the history
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:
  llvm/llvm-project@fb77ca0
  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: actions/runner-images#9491
Signed-off-by: Ilya Maximets <i.maximets@ovn.org>
Acked-by: Eelco Chaudron <echaudro@redhat.com>
Acked-by: Aaron Conole <aconole@redhat.com>
Signed-off-by: Dumitru Ceara <dceara@redhat.com>
(cherry picked from OVS commit bb7dfa652218f36768128c00664ee7cc146baea9)
  • Loading branch information
igsilya authored and dceara committed Mar 12, 2024
1 parent db0c556 commit 63b35e2
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -225,6 +225,14 @@ jobs:
sudo chmod +x /usr/bin/crun
echo "New crun version: "$(crun --version)
- name: Reduce ASLR entropy
if: matrix.cfg.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
Expand Down

0 comments on commit 63b35e2

Please sign in to comment.