diff --git a/sycl/test-e2e/AddressSanitizer/misaligned/misalign-long.cpp b/sycl/test-e2e/AddressSanitizer/misaligned/misalign-long.cpp index 288feb18fe60c..9be29ab2bef4a 100644 --- a/sycl/test-e2e/AddressSanitizer/misaligned/misalign-long.cpp +++ b/sycl/test-e2e/AddressSanitizer/misaligned/misalign-long.cpp @@ -5,6 +5,9 @@ // RUN: %{run} not --crash %t2.out 2>&1 | FileCheck %s // RUN: %{build} %device_asan_flags -O2 -g -o %t3.out // RUN: %{run} not --crash %t3.out 2>&1 | FileCheck %s +// An unlimited stack selects Linux's legacy mmap layout, allowing Shared USM +// addresses below the usual PVC range starting at 0x700000000000. +// RUN: %if arch-intel_gpu_pvc %{ %{run} not --crash sh -c 'ulimit -s unlimited && exec "$@"' sh %t3.out 2>&1 | FileCheck %s %} #include #include #include diff --git a/unified-runtime/source/loader/layers/sanitizer/sanitizer_common/sanitizer_allocator.cpp b/unified-runtime/source/loader/layers/sanitizer/sanitizer_common/sanitizer_allocator.cpp index 075558dab320d..9a3421ad64f7d 100644 --- a/unified-runtime/source/loader/layers/sanitizer/sanitizer_common/sanitizer_allocator.cpp +++ b/unified-runtime/source/loader/layers/sanitizer/sanitizer_common/sanitizer_allocator.cpp @@ -33,7 +33,14 @@ void validateSharedUSM([[maybe_unused]] uptr Allocated, [[maybe_unused]] DeviceType DeviceType) { switch (DeviceType) { case DeviceType::GPU_PVC: - assert((Allocated >> 44) == 0x7); + // FIXME: ASan supports all lower 47-bit addresses, including Shared USM + // placed below 0x700000000000 by Linux. MSan/TSan discard more address + // bits, so relaxing their checks could alias shadow memory. They can still + // hit this assertion until their shadow mappings support the wider range. + if (getContext()->enabledType == SanitizerType::AddressSanitizer) + assert((Allocated >> 47) == 0); + else + assert((Allocated >> 44) == 0x7); break; default: break;