[PHP] fix: preserve unix socket path ownership in stat#753
Merged
brandonpayton merged 2 commits intoJul 10, 2026
Conversation
6 tasks
brandonpayton
changed the base branch from
integration/kd-6nz-php-phpt-harness-only-base
to
integration/kd-6nz-php-phpt-batch-1-kernel-fixes
July 10, 2026 17:57
brandonpayton
merged commit Jul 10, 2026
91d1395
into
integration/kd-6nz-php-phpt-batch-1-kernel-fixes
1 check passed
brandonpayton
deleted the
gascity/kd-6nz/split-pr717-unix-socket-path-ownership
branch
July 10, 2026 17:57
This was referenced Jul 11, 2026
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.
Why
A filesystem-backed AF_UNIX socket is a pathname node with ordinary owner, group, mode, timestamps, and link metadata.
chown(2),chmod(2), and the stat family must round-trip that VFS state; only the reported file type isS_IFSOCK.Kandelo instead returned a fully synthetic record for every registered Unix-socket path: fixed inode/mode, the caller's current credentials, and zero timestamps. That discarded changes made through the VFS and made PHP and other programs observe false metadata.
What
unix_socket_path_stathelper used bystat,lstat, andfstatatfor currently registered AF_UNIX paths.S_IFSOCK.0777 & ~umask, then records the creating process's uid/gid.chmod/chownround-trips throughstat,lstat, andfstatat.docs/posix-status.md.Review changes
The original commit exposed the backing placeholder's hard-coded
0600, which would have regressed the previous default visible mode (0755with the default022umask). Review added commitcf73d23d4to derive the creation mode from the process umask, expand coverage, remove an unexplainedst_nlink == 0rewrite, and document the remaining registry boundary. The original commit was not rewritten.View
Accept after the review fix. The VFS is now authoritative for pathname-socket metadata, and the kernel registry supplies only the socket type classification. This is shared kernel behavior with no structural ABI change and no Node/browser-specific branch.
Current limitation: the socket classification applies while the pathname is registered. Registry state does not yet follow hard links or renames, and process cleanup can leave the backing placeholder as an ordinary VFS file.
Focused validation
On both the PR branch and a clean replay onto the live batch-1 tip:
cargo test -p kandelo --target aarch64-apple-darwin --lib unix_socket -- --nocaptureResult each time: 9 passed, 0 failed. The full kernel/host/libc/POSIX/ABI gate remains deferred to the final batch tree.
Provenance
Supersedes fork-headed PR #733. Original head commit
3a46eb51619f242fea44dd5978fca33aee31d714was preserved; the review fix was appended without force-pushing.