[all-commits] [llvm/llvm-project] 5ffe95: [lsan] Move allocator base to avoid conflict with ...

Fangrui Song via All-commits all-commits at lists.llvm.org
Fri Apr 14 10:19:07 PDT 2023


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 5ffe955570a5d743bbbae204ce1b132e89fa86dc
      https://github.com/llvm/llvm-project/commit/5ffe955570a5d743bbbae204ce1b132e89fa86dc
  Author: Fangrui Song <i at maskray.me>
  Date:   2023-04-14 (Fri, 14 Apr 2023)

  Changed paths:
    M compiler-rt/lib/lsan/lsan_allocator.h

  Log Message:
  -----------
  [lsan] Move allocator base to avoid conflict with high-entropy ASLR for x86-64 Linux

This ports D148280 for ASan.

On x86-64 Linux, when mmap_rnd_bits is set to 32 (the maximum `ARCH_MMAP_RND_BITS_MAX`),
the allocator space `[kAllocatorSpace,kAllocatorSpace+kAllocatorSize)`
collides with the PIE load base range (0x555555554000 upto `2**mmap_rnd_bits * pagesize` away),
which can cause the allocation to fail.
Using 0x500000000000ULL as the base address avoids this problem and works with
AArch64 Linux and FreeBSD as well.

While here, change s390x to use 0x500000000000ULL as well. See D78644
discussions that the address works.

Reviewed By: thurston, vitalybuka

Differential Revision: https://reviews.llvm.org/D148193




More information about the All-commits mailing list