File tree Expand file tree Collapse file tree 1 file changed +11
-6
lines changed
source/loader/layers/sanitizer/asan Expand file tree Collapse file tree 1 file changed +11
-6
lines changed Original file line number Diff line number Diff line change @@ -721,7 +721,10 @@ ur_result_t AsanInterceptor::prepareLaunch(
721721 ContextInfo->Handle, DeviceInfo->Handle, (uptr)Ptr)) {
722722 ReportInvalidKernelArgument(Kernel, ArgIndex, (uptr)Ptr,
723723 ValidateResult, PtrPair.second);
724- exitWithErrors();
724+ if (ValidateResult.Type !=
725+ ValidateUSMResult::MAYBE_HOST_POINTER) {
726+ exitWithErrors();
727+ }
725728 }
726729 }
727730 }
@@ -864,13 +867,15 @@ AsanInterceptor::findAllocInfoByAddress(uptr Address) {
864867 std::shared_lock<ur_shared_mutex> Guard(m_AllocationMapMutex);
865868 auto It = m_AllocationMap.upper_bound(Address);
866869 if (It == m_AllocationMap.begin()) {
867- return std::optional<AllocationIterator>{} ;
870+ return std::nullopt ;
868871 }
869872 --It;
870- // Make sure we got the right AllocInfo
871- assert(Address >= It->second->AllocBegin &&
872- Address < It->second->AllocBegin + It->second->AllocSize &&
873- "Wrong AllocInfo for the address");
873+
874+ // Maybe it's a host pointer
875+ if (Address < It->second->AllocBegin ||
876+ Address >= It->second->AllocBegin + It->second->AllocSize) {
877+ return std::nullopt;
878+ }
874879 return It;
875880}
876881
You can’t perform that action at this time.
0 commit comments