diff options
author | Andrey Kazmin <a.kazmin@partner.samsung.com> | 2021-08-31 16:03:08 +0300 |
---|---|---|
committer | Slava Barinov <v.barinov@samsung.com> | 2021-09-10 15:07:17 +0300 |
commit | 0ef98268a9a216acad2f778ae3cdae64c382d098 (patch) | |
tree | b80bc48acb1c67ca21b1fa4cb313c86482cb2a73 | |
parent | 72b9c5c7eb7795ee7bbd55540b1b96730314aaf8 (diff) | |
download | gcc-sandbox/vbarinov/newmerge.tar.gz gcc-sandbox/vbarinov/newmerge.tar.bz2 gcc-sandbox/vbarinov/newmerge.zip |
[HWASan] Add missed procfs mounting and ulimit disabling for HWASantizen_6.5.m2_releasesubmit/tizen_base/20210910.123310submit/tizen_6.5_base/20211027.200601submit/tizen_6.5_base/20211027.183101submit/tizen_6.5_base/20211026.180901accepted/tizen/base/tool/20210913.002621accepted/tizen/6.5/base/tool/20211027.115300accepted/tizen/6.5/base/20230714.002505tizen_6.5_basesandbox/vbarinov/newmergeaccepted/tizen_6.5_base_toolaccepted/tizen_6.5_base
Move MaybeDisableUlimit from asan_rtl.cpp to common code
* libsanitizer/asan/asan_rtl.cpp: removed MaybeDisableUlimit definition
* libsanitizer/hwasan/hwasan.cpp: added calls in __hwasan_init to MaybeDisableUlimit
and MaybeMountProcFS
* libsanitizer/sanitizer_common/sanitizer_libc.cpp: added MaybeDisableUlimit declaration
* libsanitizer/sanitizer_common/sanitizer_libc.h: added MaybeDisableUlimit definition
Change-Id: Ic1cdcfaf48412d005a6de09c578fd8668a3514e9
Signed-off-by: Andrey Kazmin <a.kazmin@partner.samsung.com>
-rw-r--r-- | libsanitizer/asan/asan_rtl.cpp | 5 | ||||
-rw-r--r-- | libsanitizer/hwasan/hwasan.cpp | 3 | ||||
-rw-r--r-- | libsanitizer/sanitizer_common/sanitizer_libc.cpp | 5 | ||||
-rw-r--r-- | libsanitizer/sanitizer_common/sanitizer_libc.h | 1 |
4 files changed, 9 insertions, 5 deletions
diff --git a/libsanitizer/asan/asan_rtl.cpp b/libsanitizer/asan/asan_rtl.cpp index d2334d5f2e9..1144e41e0b9 100644 --- a/libsanitizer/asan/asan_rtl.cpp +++ b/libsanitizer/asan/asan_rtl.cpp @@ -398,11 +398,6 @@ static bool UNUSED __local_asan_dyninit = [] { }(); #endif -static void MaybeDisableUlimit() { - if (!AddressSpaceIsUnlimited()) - SetAddressSpaceUnlimited(); -} - static void AsanInitInternal() { if (LIKELY(asan_inited)) return; SanitizerToolName = "AddressSanitizer"; diff --git a/libsanitizer/hwasan/hwasan.cpp b/libsanitizer/hwasan/hwasan.cpp index e8e81fd2da2..53cc947a219 100644 --- a/libsanitizer/hwasan/hwasan.cpp +++ b/libsanitizer/hwasan/hwasan.cpp @@ -274,6 +274,9 @@ void __hwasan_init() { InitTlsSize(); + MaybeMountProcFS(); + MaybeDisableUlimit(); + CacheBinaryName(); InitializeFlags(); diff --git a/libsanitizer/sanitizer_common/sanitizer_libc.cpp b/libsanitizer/sanitizer_common/sanitizer_libc.cpp index 2d78f1eb93c..0d27965b483 100644 --- a/libsanitizer/sanitizer_common/sanitizer_libc.cpp +++ b/libsanitizer/sanitizer_common/sanitizer_libc.cpp @@ -289,4 +289,9 @@ bool MaybeMountProcFS() { return true; } +void MaybeDisableUlimit() { + if (!AddressSpaceIsUnlimited()) + SetAddressSpaceUnlimited(); +} + } // namespace __sanitizer diff --git a/libsanitizer/sanitizer_common/sanitizer_libc.h b/libsanitizer/sanitizer_common/sanitizer_libc.h index d436d62023b..3445ba84f2f 100644 --- a/libsanitizer/sanitizer_common/sanitizer_libc.h +++ b/libsanitizer/sanitizer_common/sanitizer_libc.h @@ -85,6 +85,7 @@ extern "C" int mount(const char *source, const char *target, const void *data); bool MaybeMountProcFS(); +void MaybeDisableUlimit(); } // namespace __sanitizer |