summaryrefslogtreecommitdiff
path: root/src/pal/src/loader/module.cpp
diff options
context:
space:
mode:
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 e39cd6e..4dc06d0 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
@@ -802,6 +806,17 @@ PAL_UnregisterModule(
PERF_EXIT(PAL_UnregisterModule);
}
+#ifdef TIZEN_ASAN_ENVIRONMENT
+PALIMPORT
+BOOL
+PALAPI
+PAL_IsSanitizedModule(
+ IN HINSTANCE hInstance)
+{
+ return ((MODSTRUCT *)hInstance)->is_sanitized;
+}
+#endif // TIZEN_ASAN_ENVIRONMENT
+
/*++
PAL_LOADLoadPEFile
@@ -1548,6 +1563,10 @@ static MODSTRUCT *LOADAllocModule(NATIVE_LIBRARY_HANDLE dl_handle, LPCSTR name)
#else // NEED_DLCOMPAT
module->refcount = 1;
#endif // NEED_DLCOMPAT
+
+#ifdef TIZEN_ASAN_ENVIRONMENT
+ module->is_sanitized = FALSE;
+#endif // TIZEN_ASAN_ENVIRONMENT
module->self = module;
module->hinstance = nullptr;
module->threadLibCalls = TRUE;
@@ -1622,6 +1641,10 @@ static MODSTRUCT *LOADAddModule(NATIVE_LIBRARY_HANDLE dl_handle, LPCSTR libraryN
exe_module.prev->next = module;
exe_module.prev = module;
+#ifdef TIZEN_ASAN_ENVIRONMENT
+ module->is_sanitized = module_is_sanitized(dl_handle);
+#endif // TIZEN_ASAN_ENVIRONMENT
+
#if RETURNS_NEW_HANDLES_ON_REPEAT_DLOPEN
module->inode = stat_buf.st_ino;
module->device = stat_buf.st_dev;