SWDEV-490323 - Fix validateMemAccess in hipMemset

Changed the validation to occur on the sub-object rather than the parent.

Change-Id: I87bf5ef3526d0db9304099ef9ac1a5494e9a01a9


[ROCm/clr commit: 5da72f9d52]
Этот коммит содержится в:
Ioannis Assiouras
2024-10-09 11:34:41 +01:00
родитель 170e45b879
Коммит 043271a3e6
+5 -5
Просмотреть файл
@@ -3279,16 +3279,16 @@ hipError_t ihipMemset_validate(void* dst, int64_t value, size_t valueSize,
return hipErrorInvalidValue;
}
// In case of vmm sub object, validate using parents vaddr mem object.
if (memory->parent() && (memory->getMemFlags() & CL_MEM_VA_RANGE_AMD)) {
memory = memory->parent();
}
// Validate Mem Access in case of VMM Memory
if (!memory->ValidateMemAccess(*hip::getCurrentDevice()->devices()[0], true)) {
return hipErrorUnknown;
}
// In case of vmm sub object, validate using parents vaddr mem object.
if (memory->parent() && (memory->getMemFlags() & CL_MEM_VA_RANGE_AMD)) {
memory = memory->parent();
}
// Return error if sizeBytes passed to memcpy is more than the actual size allocated
if (sizeBytes > (memory->getSize() - offset)){
return hipErrorInvalidValue;