Repository navigation
android: the control socket no longer kills the app on launch - #1214
Merged
Merged
Conversation
Signed-off-by: fizzy pop-os-claude-2 <slot+pop-os-claude-2@fizzy.invalid>
|
TRIAGE @1490707c auto: mechanical rules met (fizzy-* app author, names work#1192, 37 non-test lines <= 400, no risky path). Labelled |
Contributor
Where this PR standsStage: Author's turn What the PM needs before approving (ticks as it is met; the full CI runs only at the end, after the reviews are clean):
Reviews at the current commit (
Updated 2026-11-11 22:37 UTC by the PM. This comment is edited in place. |
auto-merge was automatically disabled
November 11, 2026 22:01
Pull request was closed
github-merge-queue
Bot
removed this pull request from the merge queue due to failed status checks
Nov 11, 2026
This branch was successfully deployed
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.
android: the control socket no longer kills the app on launch
Part of fizzyedit/work#1192
In plain words
Every fizzy app on Android died right after starting. While it set up a private folder for its local control connection, it asked the system to lock the folder down in a way Android's security filter forbids, and Android ended the app on the spot. Now it locks the folder down another way that Android allows. The folder is just as private as before, and the check that it is a real folder is stricter.
What changes
What you will notice
On Android, a fizzy app starts and stays open instead of closing at once. Nothing changes on desktop.
How we know it works
On Linux the server's tests pass: the existing one that checks the folder is private to its owner, and the new one that refuses a link in the folder's place. The new test also passes without the fix, because the folder setup already refused the link. It guards the new path. It does not reproduce the crash, which happens only on Android. In a trial build of the console APK with this patch, the app library no longer contains the forbidden system call (the shipped build has one). After the merge, Ops runs the check on the lab phone (fizzy-test-android): start the rebuilt APK and confirm logcat has no SIGSYS.
How this serves fizzy
It keeps fizzy on every platform it promises, so apps built on it run on Android phones instead of dying at launch (Platform).
For agents: technical summary
Goal
Stop the SIGSYS (seccomp, syscall 452
fchmodat2) at control-server start on Android.control_serverdefaults to true, so every fizzy app on Android hits it.What changed and why
app/control/Server.zigstart: the old code wasstatFile(follow_symlinks=false), then aNotAFoldercheck, thensetFilePermissions(..., .{ .follow_symlinks = false }). In Zig 0.17,std/Io/Threaded.zighave_fchmodat_flagsis false on Android, soposixFchmodatcallslinux.fchmodat2directly for flags != 0. Android's seccomp kills the process before the ENOSYS fallback can run. The new code isopenDir(dir, .{ .follow_symlinks = false, .iterate = true })+folder.setPermissions(0o700), which isfchmodon the fd. O_NOFOLLOW|O_DIRECTORY refuses a link (SymLinkLoop) or a file (NotDir), and there is no window between the check and the chmod..iterate = trueavoids O_PATH, wherefchmodgives EBADF (std's errnoBug). The socket's own 0o600 chmod (no flags, goes through bionic) is unchanged.New test: "a link in the socket folder's place is refused, and its target keeps its mode" (skipped on Windows).
How it was verified
zig build: 85/85 steps succeeded.zig build test: 225/225 steps succeeded.zig build test -Dtest-filter="socket folder" -Dtest-filter="reaches the UI thread": fizzy-control-server-tests 3 pass (3 total), none skipped.zig build apkwith this patch gives a libmain.so with 0 fchmodat2 sites. The shipped pmconsole-next.apk has 1, at vaddr 0x6e02c0. The trial APK is at outbox/t357/pmconsole-t357-trial.apk.Not done / follow-ups
llvm-objdump -dof its libmain.so shows nomov w8, #0x1c4before ansvc #0, install it on fizzy-test-android (never nothing-phone-3) and start it. If it dies again, the new syscall number means a different std call and a new kickoff.Part of fizzyedit/work#1192