SWDEV-439234 - Access check before memcpy and kernel operations.

Change-Id: I7057125c03460db205409e19980145298c190fe2


[ROCm/clr commit: 6211037f63]
This commit is contained in:
kjayapra-amd
2024-07-19 10:16:18 -04:00
committato da Karthik Jayaprakash
parent 29e9bed35d
commit eecbcddaf3
9 ha cambiato i file con 110 aggiunte e 34 eliminazioni
@@ -545,6 +545,14 @@ Device* Memory::GetDeviceById() {
return getContext().devices()[device_idx];
}
// =================================================================================================
bool Memory::ValidateMemAccess(const Device& dev, bool read_write) {
if (flags_ & CL_MEM_VA_RANGE_AMD) {
return dev.ValidateMemAccess(*this, read_write);
}
return true;
}
void Buffer::initDeviceMemory() {
deviceMemories_ = reinterpret_cast<DeviceMemory*>(reinterpret_cast<char*>(this) + sizeof(Buffer));
memset(deviceMemories_, 0, NumDevicesWithP2P() * sizeof(DeviceMemory));