Repository navigation
zygisk: exempt the manager host from DENY_PROCESS_PTRACE on GrapheneOS - #1019
Open
david568303 wants to merge 1 commit into
Open
david568303 wants to merge 1 commit into
david568303 wants to merge 1 commit into
Conversation
The parasitic manager could not launch on GrapheneOS even with the DCL
workaround in place: tapping its notification (or the shortcut) aborted
the host spawn with
selinux_android_setcontext(2000, 0,
"platform:privapp:targetSdkVersion=36:partition=system:complete",
"org.matrix.vector.manager", grapheneos_flags: "100") failed
-> zygote64 SIGABRT (crash-loop)
grapheneos_flags is SELinuxFlags, printed in hex: 0x100 == 1<<8 ==
DENY_PROCESS_PTRACE. SELinuxFlags.get() starts from ALL_RESTRICTIONS and
only clears DENY_PROCESS_PTRACE when AswDenyNativeDebug returns false,
but that switch is immutably true for every system app — and the host,
com.android.shell, is a system app. GrapheneDclHooker already forces the
three DCL switches off for the host, which is why bits 0..7 are gone and
the surviving flag is exactly 0x100. The manager is injected over ptrace
(NeoZygisk/Zygisk), so with DENY_PROCESS_PTRACE armed the context
transition for the host process fails and the spawn aborts.
Add AswDenyNativeDebug to the set of switches forced off for the manager
host (same getImmutableValue override, same host-only guard). That
clears DENY_PROCESS_PTRACE for the host alone, so the parasitic manager
specializes and the notification opens it — module only, no standalone
manager APK required. Every other app keeps GrapheneOS's verdict.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01SNf36vn5z9zfgzzEF5LXRJ
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.
The parasitic manager could not launch on GrapheneOS even with the DCL workaround in place: tapping its notification (or the shortcut) aborted the host spawn with
selinux_android_setcontext(2000, 0,
"platform:privapp:targetSdkVersion=36:partition=system:complete",
"org.matrix.vector.manager", grapheneos_flags: "100") failed
-> zygote64 SIGABRT (crash-loop)
grapheneos_flags is SELinuxFlags, printed in hex: 0x100 == 1<<8 == DENY_PROCESS_PTRACE. SELinuxFlags.get() starts from ALL_RESTRICTIONS and only clears DENY_PROCESS_PTRACE when AswDenyNativeDebug returns false, but that switch is immutably true for every system app — and the host, com.android.shell, is a system app. GrapheneDclHooker already forces the three DCL switches off for the host, which is why bits 0..7 are gone and the surviving flag is exactly 0x100. The manager is injected over ptrace (NeoZygisk/Zygisk), so with DENY_PROCESS_PTRACE armed the context transition for the host process fails and the spawn aborts.
Add AswDenyNativeDebug to the set of switches forced off for the manager host (same getImmutableValue override, same host-only guard). That clears DENY_PROCESS_PTRACE for the host alone, so the parasitic manager specializes and the notification opens it — module only, no standalone manager APK required. Every other app keeps GrapheneOS's verdict.
issue #997