apply hidden API policy after exec spawning#36
Closed
inthewaves wants to merge 2 commits into
Closed
Conversation
Zygote-forked app processes decode hidden API and test API policy from runtime flags in ZygoteHooks.nativePostForkChild. This change splits that policy setup into helpers that preserve existing zygote behavior while making the same decoding sequence reusable by the exec-spawn startup path.
Exec-spawned app processes can bypass the zygote fork hook, so they were reaching app
code without applying the hidden API and test API policy carried in zygote runtime flags.
This change adds a post-exec hook that decodes those flags and applies the same
process-local ART policy before app code is loaded.
Test: atest GosCompatSecureSpawnTests
Test: atest CtsHiddenApiBlocklistCurrentApiTestCases CtsHiddenApiBlocklistTestApiTestCases
(both with exec spawning on, then re-running both tests after turning off exec
spawning + reboot)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Changeset:
Closes GrapheneOS/os-issue-tracker#7899
Exec-spawned app processes can bypass the zygote fork hook, so they were reaching app code without applying the hidden API and test API policy carried in zygote runtime flags. This change adds a post-exec hook that decodes those flags and applies the same process-local ART policy before app code is loaded.
atest GosCompatSecureSpawnTestsatest CtsHiddenApiBlocklistCurrentApiTestCases CtsHiddenApiBlocklistTestApiTestCases(both with exec spawning on, then re-running both tests after turning off exec spawning + reboot). Without this changeset, these tests were failing with exec spawning on but passing with it off