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
이 커밋은 다음에 포함됨:
foreman
2015-04-09 08:41:37 -04:00
부모 fbfb129ae9
커밋 45fd651d2f
2개의 변경된 파일과 4개의 추가작업 그리고 12개의 파일을 삭제
+3 -9
파일 보기
@@ -203,9 +203,7 @@ NullDevice::create(CALtarget target)
NULL,
NULL,
NULL,
AMD_OCL_SC_LIB,
&::malloc,
&::free
AMD_OCL_SC_LIB
};
// Initialize the compiler handle
acl_error error;
@@ -949,9 +947,7 @@ Device::create(CALuint ordinal, CALuint numOfDevices)
NULL,
NULL,
NULL,
AMD_OCL_SC_LIB,
&::malloc,
&::free
AMD_OCL_SC_LIB
};
// Initialize the compiler handle
acl_error error;
@@ -1259,9 +1255,7 @@ Device::init()
NULL,
NULL,
NULL,
AMD_OCL_SC_LIB,
&::malloc,
&::free
AMD_OCL_SC_LIB
};
hsaCompiler_ = NULL;