summaryrefslogtreecommitdiff
path: root/src/vm/dllimport.cpp
diff options
context:
space:
mode:
authorVyacheslav Cherkashin <v.cherkashin@samsung.com>2019-07-22 13:40:47 +0300
committerVyacheslav Cherkashin <v.cherkashin@samsung.com>2019-08-19 20:53:46 +0300
commitc4bd509ecf92fb953ab084da69ae2fdef7393af5 (patch)
treea65b6ccf0cf4d55bb768cc8c611ed3f83ef643d0 /src/vm/dllimport.cpp
parent915d0e7988c3b8bf0260b4e8931b5e9ac5c12fc8 (diff)
downloadcoreclr-c4bd509ecf92fb953ab084da69ae2fdef7393af5.tar.gz
coreclr-c4bd509ecf92fb953ab084da69ae2fdef7393af5.tar.bz2
coreclr-c4bd509ecf92fb953ab084da69ae2fdef7393af5.zip
[Tizen] Implement ASan wrapper for Linux ARM32
This commit implements wrappers that allow interception transitions from managed to external unmanaged code (CIL -> native) and back (native -> CIL). This allows enable/disable ASan during transitions. Due to this, we sanitize only external code, which allows us to achieve acceptable performance. Change-Id: I53ecdc14d28f7210cd9e7f5bd4db0c8ef5ed81fc Signed-off-by: Vyacheslav Cherkashin <v.cherkashin@samsung.com>
Diffstat (limited to 'src/vm/dllimport.cpp')
-rw-r--r--src/vm/dllimport.cpp13
1 files changed, 13 insertions, 0 deletions
diff --git a/src/vm/dllimport.cpp b/src/vm/dllimport.cpp
index eed690454d..2ee15f675d 100644
--- a/src/vm/dllimport.cpp
+++ b/src/vm/dllimport.cpp
@@ -46,6 +46,10 @@
#include "compile.h"
#endif // FEATURE_PREJIT
+#ifdef TIZEN_ASAN_ENVIRONMENT
+#include <tizenasanenv.h>
+#endif // TIZEN_ASAN_ENVIRONMENT
+
#include "eventtrace.h"
#include "clr/fs/path.h"
using namespace clr::fs;
@@ -6696,6 +6700,15 @@ VOID NDirect::NDirectLink(NDirectMethodDesc *pMD)
LPVOID pvTarget = NDirectGetEntryPoint(pMD, hmod);
if (pvTarget)
{
+#ifdef TIZEN_ASAN_ENVIRONMENT
+ if (PAL_IsSanitizedLibraryDirect(hmod))
+ {
+ pvTarget = TizenASanEnv::CreateWrapper(pvTarget,
+ TizenASanEnv::PushAndEnableASan,
+ TizenASanEnv::PopAndDisableASan);
+ }
+#endif // TIZEN_ASAN_ENVIRONMENT
+
pMD->SetNDirectTarget(pvTarget);
fSuccess = TRUE;
}