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
Acked-by: Eelco Chaudron <[email protected]>
Acked-by: Dumitru Ceara <[email protected]>
Acked-by: Aaron Conole <[email protected]>
Signed-off-by: Ilya Maximets <[email protected]>
  • Loading branch information
igsilya committed Mar 12, 2024
1 parent 33f45de commit fa0dfa1
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions .github/workflows/build-and-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -238,6 +238,14 @@ jobs:
if: matrix.m32 != ''
run: sudo apt install -y gcc-multilib

- 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: prepare
run: ./.ci/linux-prepare.sh

Expand Down

0 comments on commit fa0dfa1

Please sign in to comment.