diff --git a/core/java/com/android/internal/os/ZygoteInit.java b/core/java/com/android/internal/os/ZygoteInit.java index de51f8c1e0b9f..033632f8ea3d4 100644 --- a/core/java/com/android/internal/os/ZygoteInit.java +++ b/core/java/com/android/internal/os/ZygoteInit.java @@ -787,6 +787,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; }