summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author Evgenii Stepanov <eugenis@google.com> 2020-03-06 15:56:59 -0800
committer Evgenii Stepanov <eugenis@google.com> 2020-03-14 00:10:02 +0000
commiteeff2cf7531f06816c168131f641f98b5fcbea81 (patch)
treebe545f3e47267db92629f9378ffe4759b7dca357
parent6b7b2300c4154486cbc3bd6a2d80a68c49bf231e (diff)
Enable gwp-asan in system_server.
Enables gwp-asan in system_server with a small probability, same as any native process or system app. Bug: 149991821 Test: kill system_server in a loop - find "GWP" in /proc/$PID/maps eventually Change-Id: I3900f5d277d28987883a918d62fe9390c780ac30 (cherry picked from commit 2bb1dba5c7a3a27d03f83eea5529923c4d517bd2)
-rw-r--r--core/java/com/android/internal/os/ZygoteInit.java4
1 files changed, 4 insertions, 0 deletions
diff --git a/core/java/com/android/internal/os/ZygoteInit.java b/core/java/com/android/internal/os/ZygoteInit.java
index 0bfd65936b4a..ec1f516df5f3 100644
--- a/core/java/com/android/internal/os/ZygoteInit.java
+++ b/core/java/com/android/internal/os/ZygoteInit.java
@@ -761,6 +761,10 @@ public class ZygoteInit {
* this is present in all ARMv8 CPUs; this flag has no effect on other platforms. */
parsedArgs.mRuntimeFlags |= Zygote.MEMORY_TAG_LEVEL_TBI;
+ /* Enable gwp-asan on the system server with a small probability. This is the same
+ * policy as applied to native processes and system apps. */
+ parsedArgs.mRuntimeFlags |= Zygote.GWP_ASAN_LEVEL_LOTTERY;
+
if (shouldProfileSystemServer()) {
parsedArgs.mRuntimeFlags |= Zygote.PROFILE_SYSTEM_SERVER;
}