P4 to Git Change 1138941 by emankov@em-hsa-amd on 2015/04/09 08:28:04

ECR #333753 - ORCA RT: aclCompilerInit usage fix

	Passing pointers on CRT memory management functions to dynamically loaded library is unsafe and may lead to memory corruption. But actually the pointers aren't actually passed.
	They are cut off by the struct size: sizeof(aclCompilerOptions_0_8) and hence never being called.

	P.S.
	If it was aclCompilerOptions_0_8_1 the pointers would be taken into account and a heap corruption would occur. So the change intended to liquidate possible misunderstanding of malloc & free functions usage, and doesn't change the behaviour of aclCompilerInit function at all.

	Testing: pre check-in

	Reviewers: German Andreev, Stanislav Mekhanoshin

Affected files ...

... //depot/stg/opencl/drivers/opencl/runtime/device/cpu/cpudevice.cpp#271 edit
... //depot/stg/opencl/drivers/opencl/runtime/device/gpu/gpudevice.cpp#507 edit
This commit is contained in:
foreman
2015-04-09 08:41:37 -04:00
vanhempi fbfb129ae9
commit 45fd651d2f
2 muutettua tiedostoa jossa 4 lisäystä ja 12 poistoa
@@ -68,9 +68,7 @@ Device::init()
NULL,
NULL,
NULL,
NULL,
&::malloc,
&::free
NULL
};
acl_error error;
compiler_ = aclCompilerInit(&opts, &error);