From: Lukasz Kostyra Date: Tue, 10 Oct 2017 10:56:59 +0000 (+0200) Subject: Enable ASLR X-Git-Tag: submit/tizen/20171011.101248~1 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=955e0f2e81bc779fa65540c0d71f0f99fd79ad3c;p=platform%2Fcore%2Fsecurity%2Ftef-simulator.git Enable ASLR Change-Id: Idaa63fdf80a8252a931685040481e6763358feb1 --- diff --git a/CMakeLists.txt b/CMakeLists.txt index e6daff2..0273513 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -28,10 +28,9 @@ INCLUDE(FindPkgConfig) ############################# compiler flags ################################## -# If supported for the target machine, emit position-independent code,suitable -# for dynamic linking and avoiding any limit on the size of the global offset -# table. This option makes a difference on the m68k, PowerPC and SPARC. -ADD_DEFINITIONS("-fPIC") +# Force PIE +SET(CMAKE_POSITION_INDEPENDENT_CODE "True") +SET(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -pie") # SECOS SIM define used in the project ADD_DEFINITIONS("-D_SECOS_SIM_") diff --git a/ssflib/dep/time/ssf_time.cpp b/ssflib/dep/time/ssf_time.cpp index 1fe5d9a..833fccf 100644 --- a/ssflib/dep/time/ssf_time.cpp +++ b/ssflib/dep/time/ssf_time.cpp @@ -167,7 +167,7 @@ TEE_Result TEE_GetTAPersistentTime(TEE_Time* time) { if (result == TEE_SUCCESS) if (value == 1000) /* req ree time*/ reqSrcTee = false; - TEE_Time nowTime; + TEE_Time nowTime = { 0, 0 }; if (reqSrcTee == true) { TEE_GetSystemTime(&nowTime); TEE_Time* retTime = _TEE_GetAdjDiffTeeTime(&reqTaTime, &teeTaTime,