[all-commits] [llvm/llvm-project] 8e1afd: [ASan] Skip high-shadow and gap setup when HighMem...

Matt Turner via All-commits all-commits at lists.llvm.org
Sat Jun 6 11:34:52 PDT 2026


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 8e1afdada5d09cccb18b3ff17dac04e30645b93e
      https://github.com/llvm/llvm-project/commit/8e1afdada5d09cccb18b3ff17dac04e30645b93e
  Author: Matt Turner <mattst88 at gmail.com>
  Date:   2026-06-06 (Sat, 06 Jun 2026)

  Changed paths:
    M compiler-rt/lib/asan/asan_shadow_setup.cpp

  Log Message:
  -----------
  [ASan] Skip high-shadow and gap setup when HighMem region is empty (#202037)

On targets where the shadow offset sits above all addressable user
memory (e.g. Alpha with ASAN_SHADOW_OFFSET=0x70000000000 and a 42-bit
user VAS), kHighMemBeg is set above kHighMemEnd so the HighMem region is
empty. Since MEM_TO_SHADOW is monotonically increasing, kHighMemBeg >
kHighMemEnd implies kHighShadowBeg > kHighShadowEnd. Calling
ReserveShadowMemoryRange(kHighShadowBeg, kHighShadowEnd) passes size =
kHighShadowEnd - kHighShadowBeg + 1, which underflows to a large
negative value, and mmap() fails with ENOMEM.

ProtectGap is also skipped: there is no meaningful shadow gap between
LowShadow and an empty HighShadow.

Guard both operations on kHighMemBeg <= kHighMemEnd.



To unsubscribe from these emails, change your notification settings at https://github.com/llvm/llvm-project/settings/notifications


More information about the All-commits mailing list