Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 3a9f3ce2 authored by Automerger Merge Worker's avatar Automerger Merge Worker Committed by Android (Google) Code Review
Browse files

Merge "Merge "Clean MTE and GWP-ASan runtime flags after use." into rvc-dev...

Merge "Merge "Clean MTE and GWP-ASan runtime flags after use." into rvc-dev am: 1a7be751 am: 84ee8005" into rvc-d1-dev-plus-aosp
parents b5f493e9 8eba29ac
Loading
Loading
Loading
Loading
+4 −0
Original line number Diff line number Diff line
@@ -1787,6 +1787,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) {
@@ -1799,6 +1801,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).