2
0

Correct IPC fragment validation.

IPC create must only be used on whole ROCr allocations.
Fragments were allowing handle creation with offsets.

Change-Id: I1faa96d36bc7a6199bdc2e3ff1b8871d1a36a2fa
Este cometimento está contido em:
Sean Keely
2020-04-21 19:51:58 -05:00
ascendente b90bf473c1
cometimento 7712c7e743
+2
Ver ficheiro
@@ -889,6 +889,8 @@ hsa_status_t Runtime::IPCCreate(void* ptr, size_t len, hsa_amd_ipc_memory_t* han
info.size = sizeof(info);
if (PtrInfo(ptr, &info, nullptr, nullptr, nullptr, &block) != HSA_STATUS_SUCCESS)
return HSA_STATUS_ERROR_INVALID_ARGUMENT;
if ((info.agentBaseAddress != ptr) || (info.sizeInBytes != len))
return HSA_STATUS_ERROR_INVALID_ARGUMENT;
if ((block.base != ptr) || (block.length != len)) {
if (!IsMultipleOf(block.base, 2 * 1024 * 1024)) {
assert(false && "Fragment's block not aligned to 2MB!");