summaryrefslogtreecommitdiff
path: root/src/pal/src/loader/module.cpp
diff options
context:
space:
mode:
authorAndrey Drobyshev <a.drobyshev@samsung.com>2019-07-16 15:23:18 +0300
committer이형주/Common Platform Lab(SR)/Staff Engineer/삼성전자 <leee.lee@samsung.com>2019-10-11 08:34:37 +0900
commit864c0382fe4f332b1fb4a1e6bbea81dd1172cdfc (patch)
treeba0b30120156dfc7358f0d3621e67ec703ce93d1 /src/pal/src/loader/module.cpp
parent2204ea2f1c1332912c1374d7cc7347d5f9e67868 (diff)
downloadcoreclr-864c0382fe4f332b1fb4a1e6bbea81dd1172cdfc.tar.gz
coreclr-864c0382fe4f332b1fb4a1e6bbea81dd1172cdfc.tar.bz2
coreclr-864c0382fe4f332b1fb4a1e6bbea81dd1172cdfc.zip
[Tizen] Implement detecting of sanitized libraries
Parse ".dynamic" section (ELF dynamic array tags) of the module being added, find ".rel(a).plt" section and search it for presence of '__asan_init' symbol. Change-Id: Ie7cc4c818b791b5f00713b42ba15131325b8152c Signed-off-by: Andrey Drobyshev <a.drobyshev@samsung.com>
Diffstat (limited to 'src/pal/src/loader/module.cpp')
-rw-r--r--src/pal/src/loader/module.cpp23
1 files changed, 23 insertions, 0 deletions
diff --git a/src/pal/src/loader/module.cpp b/src/pal/src/loader/module.cpp
index c817ffe2db..74156fd215 100644
--- a/src/pal/src/loader/module.cpp
+++ b/src/pal/src/loader/module.cpp
@@ -60,6 +60,10 @@ SET_DEFAULT_DEBUG_CHANNEL(LOADER); // some headers have code with asserts, so do
#include <gnu/lib-names.h>
#endif
+#ifdef TIZEN_ASAN_ENVIRONMENT
+#include "tizenasanenvmodule.h"
+#endif // TIZEN_ASAN_ENVIRONMENT
+
using namespace CorUnix;
// In safemath.h, Template SafeInt uses macro _ASSERTE, which need to use variable
@@ -688,6 +692,25 @@ PAL_GetProcAddressDirect(
return address;
}
+#ifdef TIZEN_ASAN_ENVIRONMENT
+/*
+Function:
+ PAL_IsSanitizedLibraryDirect
+
+ Check whether the native library is sanitized.
+
+ Returns TRUE if the native library is sanitized; FALSE otherwise.
+*/
+PALIMPORT
+BOOL
+PALAPI
+PAL_IsSanitizedLibraryDirect(
+ IN NATIVE_LIBRARY_HANDLE dl_handle)
+{
+ return is_module_sanitized(dl_handle);
+}
+#endif // TIZEN_ASAN_ENVIRONMENT
+
/*++
Function:
PAL_RegisterModule