SWDEV-478097 - Check for parents size in case of VA Mem object.

Change-Id: Icfdeabeb178c0dcc8c3a4bc48eec40067985794e
Tá an tiomantas seo le fáil i:
kjayapra-amd
2024-08-17 17:17:34 -04:00
tiomanta ag Karthik Jayaprakash
tuismitheoir 6576be5602
tiomantas d7b097c994
D'athraigh 2 comhad le 6 breiseanna agus 2 scriosta
+6
Féach ar an gComhad
@@ -3162,6 +3162,12 @@ hipError_t ihipMemset_validate(void* dst, int64_t value, size_t valueSize,
// dst ptr is host ptr hence error
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();
}
// Return error if sizeBytes passed to memcpy is more than the actual size allocated
if (sizeBytes > (memory->getSize() - offset)){
return hipErrorInvalidValue;