Skip to content

apply hidden API policy after exec spawning#36

Closed
inthewaves wants to merge 2 commits into
GrapheneOS:16-qpr2from
inthewaves:exec-spawn-fix
Closed

apply hidden API policy after exec spawning#36
inthewaves wants to merge 2 commits into
GrapheneOS:16-qpr2from
inthewaves:exec-spawn-fix

Conversation

@inthewaves

@inthewaves inthewaves commented Jun 1, 2026

Copy link
Copy Markdown
Member

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.

  • Test: atest GosCompatSecureSpawnTests
  • Test: atest 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

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)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Secure spawning compatibility issue with Nikon Snapbridge app

1 participant