Don't fork USAPs with open argument buffer
Delay execution of any zygote command that may end up forking USAPs until we've released our own ZygoteCommandBuffer. Otherwise we fork the child with an open ZygoteCommandBuffer, preventing it from opening its own. Bug: 182084594 Test: Build and boot AOSP, with USAPs enabled and disabled. Change-Id: I2366367d2155a120092fbdcae13cbb3d7f4e1d16
This commit is contained in:
@@ -149,8 +149,11 @@ class ZygoteConnection {
|
||||
return null;
|
||||
}
|
||||
|
||||
if (parsedArgs.mUsapPoolStatusSpecified) {
|
||||
// Handle this once we've released the argBuffer, to avoid opening a second one.
|
||||
if (parsedArgs.mUsapPoolStatusSpecified
|
||||
|| parsedArgs.mApiDenylistExemptions != null
|
||||
|| parsedArgs.mHiddenApiAccessLogSampleRate != -1
|
||||
|| parsedArgs.mHiddenApiAccessStatslogSampleRate != -1) {
|
||||
// Handle these once we've released argBuffer, to avoid opening a second one.
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -183,18 +186,6 @@ class ZygoteConnection {
|
||||
return null;
|
||||
}
|
||||
|
||||
if (parsedArgs.mApiDenylistExemptions != null) {
|
||||
return handleApiDenylistExemptions(zygoteServer,
|
||||
parsedArgs.mApiDenylistExemptions);
|
||||
}
|
||||
|
||||
if (parsedArgs.mHiddenApiAccessLogSampleRate != -1
|
||||
|| parsedArgs.mHiddenApiAccessStatslogSampleRate != -1) {
|
||||
return handleHiddenApiAccessLogSampleRate(zygoteServer,
|
||||
parsedArgs.mHiddenApiAccessLogSampleRate,
|
||||
parsedArgs.mHiddenApiAccessStatslogSampleRate);
|
||||
}
|
||||
|
||||
if (parsedArgs.mPermittedCapabilities != 0
|
||||
|| parsedArgs.mEffectiveCapabilities != 0) {
|
||||
throw new ZygoteSecurityException("Client may not specify capabilities: "
|
||||
@@ -311,10 +302,20 @@ class ZygoteConnection {
|
||||
}
|
||||
}
|
||||
}
|
||||
// Handle anything that may need a ZygoteCommandBuffer after we've released ours.
|
||||
if (parsedArgs.mUsapPoolStatusSpecified) {
|
||||
// Now that we've released argBuffer:
|
||||
return handleUsapPoolStatusChange(zygoteServer, parsedArgs.mUsapPoolEnabled);
|
||||
}
|
||||
if (parsedArgs.mApiDenylistExemptions != null) {
|
||||
return handleApiDenylistExemptions(zygoteServer,
|
||||
parsedArgs.mApiDenylistExemptions);
|
||||
}
|
||||
if (parsedArgs.mHiddenApiAccessLogSampleRate != -1
|
||||
|| parsedArgs.mHiddenApiAccessStatslogSampleRate != -1) {
|
||||
return handleHiddenApiAccessLogSampleRate(zygoteServer,
|
||||
parsedArgs.mHiddenApiAccessLogSampleRate,
|
||||
parsedArgs.mHiddenApiAccessStatslogSampleRate);
|
||||
}
|
||||
throw new AssertionError("Shouldn't get here");
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user