[PHP] vfs: resolve pathname components across mounts#741
Merged
Conversation
This was referenced Jul 10, 2026
Walk path components in the kernel's global namespace before backend routing so symlinks, dot-dot, trailing slashes, virtual filesystems, mount crossings, and AF_UNIX pathnames share one canonical resolution model. Validate initial cwd after installing child credentials, clean up failed registrations, and cover the behavior through kernel, Node, and Chromium probes. Cwd and directory OFDs remain pathname-backed after rename or unlink, as documented. This changes syscall-visible pathname semantics inside the unmerged PHP platform batch; the aggregate ABI reconciliation remains required before the batch can land on main.
brandonpayton
force-pushed
the
gascity/kd-6nz/split-pr717-canonicalize-cwd-after-chdir
branch
from
July 11, 2026 19:29
429390c to
cc579aa
Compare
brandonpayton
changed the base branch from
integration/kd-6nz-php-phpt-harness-only-base
to
integration/kd-6nz-php-phpt-platform-fixes
July 11, 2026 19:29
brandonpayton
deleted the
gascity/kd-6nz/split-pr717-canonicalize-cwd-after-chdir
branch
July 11, 2026 19:29
13 tasks
brandonpayton
added a commit
that referenced
this pull request
Jul 13, 2026
Component walking, symlink and mount traversal, error selection, and canonical initial/current-directory behavior change existing pathname semantics. Advance ABI 31 to 32 and regenerate ABI evidence atomically. Source-PR: #741
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.
Summary
Replace the unsafe lexical cwd-only fix with a component-wise global namespace resolver used before backend routing. Pathname syscalls now preserve symlink,
./.., missing-component, trailing-slash, mount-boundary, procfs/devfs, and AF_UNIX semantics instead of normalizing the input spelling before lookup.This constituent is stacked on the open PHP platform aggregate, PR #871. It must not land independently on
main; its syscall-visible semantic change remains covered by the aggregate ABI reconciliation and full gate.Review of the original PR
The original commit (
429390c8d) was not safe to replay. It validated one pathname and then lexically collapsed.., which can store a cwd different from the directory actually reached through a symlink. The same approach also brokemissing/..,regular/., trailing slashes, VFS mount crossings, virtual namespaces, AF_UNIX registry aliases, and initial process cwd. The original commit was replaced, not retained as a misleading permanent intermediate commit.Reviewed replacement
Replacement source commit:
cc579aabb*at()pathname syscalls, cwd,realpath,statfs, exec paths, and AF_UNIX bind/connect/send paths./procand/devnames from falling through to hidden host entries while preserving the writable/dev/shmmount.Remaining boundaries
getcwd,fchdir, or dirfd-relative behavior./proc/<pid>/fd/Nmagic links preserve final metadata but do not yet provide full OFD-identity traversal.opendirstream API returnsEOPNOTSUPPfor synthetic procfs/devfs directories; normalopen(O_DIRECTORY)plusgetdents64remains the supported path.Validation on the reviewed tree
Run through
scripts/dev-shell.shunless noted:cargo test -p kandelo --target aarch64-apple-darwin --lib— 1,102 passed, 0 failed.cd host && npm run build— passed (ESM/CJS/type declarations built; existingimport.metaCJS warnings only).bash scripts/check-abi-version.sh— passed; structural snapshot and generated bindings are in sync.cd host && npx vitest run test/node-host-mounts.test.ts— 12 passed, 0 failed, including cross-mount component resolution and both invalid-initial-cwd cleanup cases../run.sh --fetch-only browser --host 127.0.0.1 --port 54742 --strictPortprepared the canonical browser path and launched Vite; the same Chromium probe against that live server passed 1/1.git diff --check— clean.The full host, libc, POSIX, Sortix, PHPT, and aggregate ABI/version gate remain intentionally deferred to PR #871's one ready-to-merge run.
Recommendation
Accept into PR #871. The replacement fixes a real platform-level pathname defect with Node/browser parity and truthful documented limits. Do not ship it independently or merge the aggregate until the aggregate ABI reconciliation is redesigned against the then-current
mainABI and the full batch gate passes.