Pass MTE RuntimeFlags to AppZygote.
Fix AppZygote process and its children (the actual service processes) ignoring android:memtagMode attribute in the app manifest. When starting a new AppZygote process, apply memtag-related flags as determined by the app manifest (and modified by compat features and actual h/w capabilities). If this is not done, MTE is always disabled in an AppZygote process, which makes it impossible to enable it in the AppZygote's children. This change has no effect unless MTE is supported in the hardware (ARMv9) and enabled in the system. Bug: 207557677 Test: CtsTaggingHostTestCases Change-Id: I8805958545fd790e4ca857184b749a21e58d68cd
This commit is contained in:
@@ -45,6 +45,8 @@ public class AppZygote {
|
||||
// Last UID/GID of the range the AppZygote can setuid()/setgid() to
|
||||
private final int mZygoteUidGidMax;
|
||||
|
||||
private final int mZygoteRuntimeFlags;
|
||||
|
||||
private final Object mLock = new Object();
|
||||
|
||||
/**
|
||||
@@ -56,11 +58,13 @@ public class AppZygote {
|
||||
|
||||
private final ApplicationInfo mAppInfo;
|
||||
|
||||
public AppZygote(ApplicationInfo appInfo, int zygoteUid, int uidGidMin, int uidGidMax) {
|
||||
public AppZygote(ApplicationInfo appInfo, int zygoteUid, int uidGidMin, int uidGidMax,
|
||||
int runtimeFlags) {
|
||||
mAppInfo = appInfo;
|
||||
mZygoteUid = zygoteUid;
|
||||
mZygoteUidGidMin = uidGidMin;
|
||||
mZygoteUidGidMax = uidGidMax;
|
||||
mZygoteRuntimeFlags = runtimeFlags;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -110,7 +114,7 @@ public class AppZygote {
|
||||
mZygoteUid,
|
||||
mZygoteUid,
|
||||
null, // gids
|
||||
0, // runtimeFlags
|
||||
mZygoteRuntimeFlags, // runtimeFlags
|
||||
"app_zygote", // seInfo
|
||||
abi, // abi
|
||||
abi, // acceptedAbiList
|
||||
|
||||
@@ -2238,7 +2238,8 @@ public final class ProcessList {
|
||||
// not the calling one.
|
||||
appInfo.packageName = app.getHostingRecord().getDefiningPackageName();
|
||||
appInfo.uid = uid;
|
||||
appZygote = new AppZygote(appInfo, uid, firstUid, lastUid);
|
||||
int runtimeFlags = decideTaggingLevel(app);
|
||||
appZygote = new AppZygote(appInfo, uid, firstUid, lastUid, runtimeFlags);
|
||||
mAppZygotes.put(app.info.processName, uid, appZygote);
|
||||
zygoteProcessList = new ArrayList<ProcessRecord>();
|
||||
mAppZygoteProcesses.put(appZygote, zygoteProcessList);
|
||||
|
||||
Reference in New Issue
Block a user