diff options
| author | 2020-02-11 00:08:13 +0000 | |
|---|---|---|
| committer | 2020-02-11 00:08:13 +0000 | |
| commit | 7d23ea156fb2d4acd0edaf1eec48072b82c8c19d (patch) | |
| tree | b22d363739c1904b0bbf4ef8edd676d35597d606 | |
| parent | 675713233207158a667060258276d6c86435bcf2 (diff) | |
| parent | b9f2f13027251d7e564bfc9a58727a1b753a1bd2 (diff) | |
Merge "[GWP-ASan] Maybe initialise GWP-ASan from Zygote." am: bd37583811 am: ea611103df am: b9f2f13027
Change-Id: I9aa4f5bba27d2017b16df76dd7b6412b13fb980d
| -rw-r--r-- | core/jni/com_android_internal_os_Zygote.cpp | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/core/jni/com_android_internal_os_Zygote.cpp b/core/jni/com_android_internal_os_Zygote.cpp index 92941b8cb22b..7290e3031d21 100644 --- a/core/jni/com_android_internal_os_Zygote.cpp +++ b/core/jni/com_android_internal_os_Zygote.cpp @@ -611,6 +611,12 @@ static void PreApplicationInit() { // Set the jemalloc decay time to 1. mallopt(M_DECAY_TIME, 1); + + // Maybe initialize GWP-ASan here. Must be called after + // mallopt(M_SET_ZYGOTE_CHILD). + bool ForceEnableGwpAsan = false; + android_mallopt(M_INITIALIZE_GWP_ASAN, &ForceEnableGwpAsan, + sizeof(ForceEnableGwpAsan)); } static void SetUpSeccompFilter(uid_t uid, bool is_child_zygote) { |