diff options
| author | 2020-06-04 23:45:19 +0000 | |
|---|---|---|
| committer | 2020-06-04 23:45:19 +0000 | |
| commit | 84ee80052cba84cdb85acd8d59c97b5722f13d7a (patch) | |
| tree | d39bad8a4ccf96bf4e38fdf0524f31b68e574743 | |
| parent | 084338eb3311d68fe6e72636363743a50fea9237 (diff) | |
| parent | 1a7be751e1a25f9b2c4228eb30c7d19e26b6d5d8 (diff) | |
Merge "Clean MTE and GWP-ASan runtime flags after use." into rvc-dev am: 1a7be751e1
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/11730039
Change-Id: I85d12658ff641d0735e7e0b0416409ebe3075d73
| -rw-r--r-- | core/jni/com_android_internal_os_Zygote.cpp | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/core/jni/com_android_internal_os_Zygote.cpp b/core/jni/com_android_internal_os_Zygote.cpp index 3d8cae8e74d0..5c444bda1838 100644 --- a/core/jni/com_android_internal_os_Zygote.cpp +++ b/core/jni/com_android_internal_os_Zygote.cpp @@ -1744,6 +1744,8 @@ static void SpecializeCommon(JNIEnv* env, uid_t uid, gid_t gid, jintArray gids, heap_tagging_level = M_HEAP_TAGGING_LEVEL_NONE; } android_mallopt(M_SET_HEAP_TAGGING_LEVEL, &heap_tagging_level, sizeof(heap_tagging_level)); + // Now that we've used the flag, clear it so that we don't pass unknown flags to the ART runtime. + runtime_flags &= ~RuntimeFlags::MEMORY_TAG_LEVEL_MASK; bool forceEnableGwpAsan = false; switch (runtime_flags & RuntimeFlags::GWP_ASAN_LEVEL_MASK) { @@ -1756,6 +1758,8 @@ static void SpecializeCommon(JNIEnv* env, uid_t uid, gid_t gid, jintArray gids, case RuntimeFlags::GWP_ASAN_LEVEL_LOTTERY: android_mallopt(M_INITIALIZE_GWP_ASAN, &forceEnableGwpAsan, sizeof(forceEnableGwpAsan)); } + // Now that we've used the flag, clear it so that we don't pass unknown flags to the ART runtime. + runtime_flags &= ~RuntimeFlags::GWP_ASAN_LEVEL_MASK; if (NeedsNoRandomizeWorkaround()) { // Work around ARM kernel ASLR lossage (http://b/5817320). |