Repository navigation
feat(fast_io): mkdirat/symlinkat/linkat sandbox helpers (SEC-1.h) - #4683
Merged
Merged
Conversation
Adds the create-class siblings to the SEC-1 dirfd carrier: mkdirat / symlinkat / linkat and the via_sandbox_or_fallback adaptors that route a single-component leaf under the receiver's DirSandbox root through the *at variant while preserving the existing path-based fallback for multi-component paths, missing sandbox, and non-Unix targets. Wires the receiver pipeline: - create_symlinks now creates symlinks through symlinkat_via_sandbox_or_fallback. - create_hardlinks creates follower hard links through linkat_via_sandbox_or_fallback, keeping fast_io::hard_link (io_uring LINKAT fast path) as the fallback so EXDEV/EPERM semantics survive. - create_directories and create_directory_incremental create new directories through mkdirat_via_sandbox_or_fallback, with fs::create_dir_all retained as the multi-component fallback. Follows the SEC-1.g pattern (PR #4671). mknodat is deferred: device/FIFO/socket creation is wrapped by the metadata crate and needs deeper refactoring before the sandbox can be threaded through; receiver-side mknod is not on the daemon-reachable TOCTOU surface today. Windows stays on path-based stdlib per the SEC-1.l NTFS-handle audit.
4 tasks
oferchen
added a commit
that referenced
this pull request
May 21, 2026
Extends the SEC-1 dirfd-anchored carrier with the metadata-application siblings: - fchmodat(dirfd, name, mode, follow_symlinks) - fchownat(dirfd, name, uid, gid, follow_symlinks) - utimensat(dirfd, name, atime, mtime, follow_symlinks) - fchmodat_via_sandbox_or_fallback / fchownat_via_sandbox_or_fallback / utimensat_via_sandbox_or_fallback adaptors that route single-component leaves under the receiver's DirSandbox root through the *at variant while preserving path-based fallbacks for multi-component paths, missing sandbox, and non-Unix targets. Pattern source: SEC-1.g unlink_via_sandbox_or_fallback. The new helpers live in a sibling at_syscalls_metadata.rs module so the SEC-1.h create-class additions (#4683) and SEC-1.i metadata-class additions can land independently without conflicting on the same file. Once both PRs merge the two modules may be re-folded into a single at_syscalls namespace as housekeeping. Receiver-side wiring of the metadata application path through these helpers is deferred follow-up: the metadata crate does not depend on fast_io today and threading DirSandbox through apply_metadata_from_file_entry requires propagating it across the transfer pipeline. Same staging strategy as SEC-1.b which landed the carrier ahead of subsequent cutover PRs.
Merged
3 tasks
oferchen
added a commit
that referenced
this pull request
May 21, 2026
…4690) * feat(fast_io): fchmodat/fchownat/utimensat sandbox helpers (SEC-1.i) Extends the SEC-1 dirfd-anchored carrier with the metadata-application siblings: - fchmodat(dirfd, name, mode, follow_symlinks) - fchownat(dirfd, name, uid, gid, follow_symlinks) - utimensat(dirfd, name, atime, mtime, follow_symlinks) - fchmodat_via_sandbox_or_fallback / fchownat_via_sandbox_or_fallback / utimensat_via_sandbox_or_fallback adaptors that route single-component leaves under the receiver's DirSandbox root through the *at variant while preserving path-based fallbacks for multi-component paths, missing sandbox, and non-Unix targets. Pattern source: SEC-1.g unlink_via_sandbox_or_fallback. The new helpers live in a sibling at_syscalls_metadata.rs module so the SEC-1.h create-class additions (#4683) and SEC-1.i metadata-class additions can land independently without conflicting on the same file. Once both PRs merge the two modules may be re-folded into a single at_syscalls namespace as housekeeping. Receiver-side wiring of the metadata application path through these helpers is deferred follow-up: the metadata crate does not depend on fast_io today and threading DirSandbox through apply_metadata_from_file_entry requires propagating it across the transfer pipeline. Same staging strategy as SEC-1.b which landed the carrier ahead of subsequent cutover PRs. * fix(fast_io): make filetime dep available on unix for SEC-1.i fallback The fchmodat/fchownat/utimensat_via_sandbox_or_fallback helpers in at_syscalls_metadata.rs use filetime::FileTime and filetime::set_symlink_file_times for the multi-component fallback path. Move filetime out of cfg(not(unix)) so it compiles on all platforms. * fix(fast_io): gate at_syscalls_metadata mod with cfg(unix) at_syscalls_metadata.rs is unix-only (libc *at calls + filetime). The mod declaration was unconditional, causing Windows builds to try compiling it and fail with 'unresolved crate filetime'. Gate both the mod declaration and the re-exports with #[cfg(unix)]. * fix(fast_io): move filetime to universal deps for non-unix syscall_batch The cfg(unix) move regressed Windows because syscall_batch.rs has a cfg(not(unix)) block that uses filetime::FileTime. Move filetime out of target-specific deps to general [dependencies] so both unix (at_syscalls_metadata fallback) and non-unix (syscall_batch) paths see it. * fix(fast_io): use inferred cast for timespec fields (musl libc::time_t deprecated) musl 1.2.0 deprecated libc::time_t in favor of a 64-bit alias. Cast unix_seconds() and nanoseconds() to the timespec field type with 'as _' so the cast picks up whichever signed integer the target's libc uses.
3 tasks done
oferchen
added a commit
that referenced
this pull request
May 21, 2026
… triggers (#4694) SEC-1.h (PR #4683) shipped mkdirat/symlinkat/linkat sandbox helpers but explicitly punted mknodat because device/FIFO/socket creation lives behind metadata-crate abstractions that do not carry DirSandbox and is not on today's daemon-reachable TOCTOU surface. Records the rationale, sketches the helper signature, and lists the explicit re-open triggers so the SEC-1 audit chain has a clear closure for the mknodat sub-question.
3 of 4 tasks
oferchen
added a commit
that referenced
this pull request
May 21, 2026
…ship (#4695) Captures the hygiene follow-up to consolidate `crates/fast_io/src/dir_sandbox/at_syscalls{,_metadata,_rename}.rs` into a single `at_syscalls` namespace now that all three SEC-1 *at* helper PRs (.h #4683, .i #4690, .j #4693) are on master. Both .i and .j module headers explicitly scheduled the re-fold; this doc turns that into a concrete plan with section dividers, re-export collapse steps, and an LoC sanity check that confirms the consolidated file remains within the post-2026-05-18 LoC policy.
This was referenced May 21, 2026
3 of 4 tasks
oferchen
added a commit
that referenced
this pull request
Aug 24, 2026
) Adds the create-class siblings to the SEC-1 dirfd carrier: mkdirat / symlinkat / linkat and the via_sandbox_or_fallback adaptors that route a single-component leaf under the receiver's DirSandbox root through the *at variant while preserving the existing path-based fallback for multi-component paths, missing sandbox, and non-Unix targets. Wires the receiver pipeline: - create_symlinks now creates symlinks through symlinkat_via_sandbox_or_fallback. - create_hardlinks creates follower hard links through linkat_via_sandbox_or_fallback, keeping fast_io::hard_link (io_uring LINKAT fast path) as the fallback so EXDEV/EPERM semantics survive. - create_directories and create_directory_incremental create new directories through mkdirat_via_sandbox_or_fallback, with fs::create_dir_all retained as the multi-component fallback. Follows the SEC-1.g pattern (PR #4671). mknodat is deferred: device/FIFO/socket creation is wrapped by the metadata crate and needs deeper refactoring before the sandbox can be threaded through; receiver-side mknod is not on the daemon-reachable TOCTOU surface today. Windows stays on path-based stdlib per the SEC-1.l NTFS-handle audit.
oferchen
added a commit
that referenced
this pull request
Aug 24, 2026
…n/.k/.l ship state Update CVE-2026-29518 and CVE-2026-43619 entries to "Mostly fixed", reflecting the SEC-1 sub-tasks now in master: - .a/.b/.c/.d/.e: DirSandbox carrier, openat2 detection, receiver wiring - .f: lstat to fstatat (PR #4668) - .g: remove to unlinkat (PR #4671) - .h: mkdir/symlink/hard_link to *at variants (PR #4683) - .k: macOS verified - .l: Windows audited (NTFS handle-based, not affected) - .m: symlink-swap attack regression (PR #4675) - .n: legitimate symlink interop regression (PR #4678) Remaining work explicitly listed: - .i (chmod/lchown/utimes to *at) - in flight - .j (rename to renameat) - in flight - mknodat for device/FIFO nodes - deferred (not daemon-reachable) - Receiver wiring for SEC-1.i helpers - deferred (carrier-first staging) Target full-Fixed status: when SEC-1.i and SEC-1.j ship and all receiver call sites are wired through DirSandbox.
oferchen
added a commit
that referenced
this pull request
Aug 24, 2026
…4690) * feat(fast_io): fchmodat/fchownat/utimensat sandbox helpers (SEC-1.i) Extends the SEC-1 dirfd-anchored carrier with the metadata-application siblings: - fchmodat(dirfd, name, mode, follow_symlinks) - fchownat(dirfd, name, uid, gid, follow_symlinks) - utimensat(dirfd, name, atime, mtime, follow_symlinks) - fchmodat_via_sandbox_or_fallback / fchownat_via_sandbox_or_fallback / utimensat_via_sandbox_or_fallback adaptors that route single-component leaves under the receiver's DirSandbox root through the *at variant while preserving path-based fallbacks for multi-component paths, missing sandbox, and non-Unix targets. Pattern source: SEC-1.g unlink_via_sandbox_or_fallback. The new helpers live in a sibling at_syscalls_metadata.rs module so the SEC-1.h create-class additions (#4683) and SEC-1.i metadata-class additions can land independently without conflicting on the same file. Once both PRs merge the two modules may be re-folded into a single at_syscalls namespace as housekeeping. Receiver-side wiring of the metadata application path through these helpers is deferred follow-up: the metadata crate does not depend on fast_io today and threading DirSandbox through apply_metadata_from_file_entry requires propagating it across the transfer pipeline. Same staging strategy as SEC-1.b which landed the carrier ahead of subsequent cutover PRs. * fix(fast_io): make filetime dep available on unix for SEC-1.i fallback The fchmodat/fchownat/utimensat_via_sandbox_or_fallback helpers in at_syscalls_metadata.rs use filetime::FileTime and filetime::set_symlink_file_times for the multi-component fallback path. Move filetime out of cfg(not(unix)) so it compiles on all platforms. * fix(fast_io): gate at_syscalls_metadata mod with cfg(unix) at_syscalls_metadata.rs is unix-only (libc *at calls + filetime). The mod declaration was unconditional, causing Windows builds to try compiling it and fail with 'unresolved crate filetime'. Gate both the mod declaration and the re-exports with #[cfg(unix)]. * fix(fast_io): move filetime to universal deps for non-unix syscall_batch The cfg(unix) move regressed Windows because syscall_batch.rs has a cfg(not(unix)) block that uses filetime::FileTime. Move filetime out of target-specific deps to general [dependencies] so both unix (at_syscalls_metadata fallback) and non-unix (syscall_batch) paths see it. * fix(fast_io): use inferred cast for timespec fields (musl libc::time_t deprecated) musl 1.2.0 deprecated libc::time_t in favor of a 64-bit alias. Cast unix_seconds() and nanoseconds() to the timespec field type with 'as _' so the cast picks up whichever signed integer the target's libc uses.
oferchen
added a commit
that referenced
this pull request
Aug 24, 2026
… triggers (#4694) SEC-1.h (PR #4683) shipped mkdirat/symlinkat/linkat sandbox helpers but explicitly punted mknodat because device/FIFO/socket creation lives behind metadata-crate abstractions that do not carry DirSandbox and is not on today's daemon-reachable TOCTOU surface. Records the rationale, sketches the helper signature, and lists the explicit re-open triggers so the SEC-1 audit chain has a clear closure for the mknodat sub-question.
oferchen
added a commit
that referenced
this pull request
Aug 24, 2026
…ship (#4695) Captures the hygiene follow-up to consolidate `crates/fast_io/src/dir_sandbox/at_syscalls{,_metadata,_rename}.rs` into a single `at_syscalls` namespace now that all three SEC-1 *at* helper PRs (.h #4683, .i #4690, .j #4693) are on master. Both .i and .j module headers explicitly scheduled the re-fold; this doc turns that into a concrete plan with section dividers, re-export collapse steps, and an LoC sanity check that confirms the consolidated file remains within the post-2026-05-18 LoC policy.
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
Extends the SEC-1 dirfd-anchored carrier with the create-class siblings:
mkdirat(dirfd, name, mode)symlinkat(target, dirfd, name)linkat(old_dirfd, old_name, new_dirfd, new_name, 0)mkdirat_via_sandbox_or_fallback/symlinkat_via_sandbox_or_fallback/linkat_via_sandbox_or_fallbackadaptors that route a single-component leaf under the receiver'sDirSandboxroot through the*atvariant while preserving the existing path-based fallback for multi-component paths, missing sandbox, and non-Unix targets.Pattern source: SEC-1.g (#4671)
unlink_via_sandbox_or_fallback.Receiver callers wired
create_symlinks(crates/transfer/src/receiver/directory/links.rs) - creates symlinks viasymlinkat_via_sandbox_or_fallback.create_hardlinks(same file) - creates follower hard links vialinkat_via_sandbox_or_fallback. The new endpoint is anchored on the sandbox dirfd; the leader endpoint stays onAT_FDCWDbecause cross-segment hardlinks may live outsidedest_dir. Falls back tofast_io::hard_link(io_uring LINKAT fast path /std::fs::hard_link) for multi-component / no-sandbox cases, preservingEXDEV/EPERMsemantics.create_directories(crates/transfer/src/receiver/directory/creation.rs) - creates directories viamkdirat_via_sandbox_or_fallback; falls back tofs::create_dir_allfor multi-component--relativeshapes the parent walk did not pre-create.create_directory_incremental(same file) - same wiring for the incremental flist path.sandboxis plumbed through both directory-creation entry points under#[cfg(unix)], matching the SEC-1.g pattern.mknodat status
Deferred. Device/FIFO/socket creation is wrapped by the
metadatacrate (create_device_node_with_fake_super,create_fifo_with_fake_super,apple_fs::mknod) and used by the local-copy executor; the receiver pipeline reaches those paths via several abstraction layers that need a deeper refactor before the sandbox can be threaded through. Receiver-side mknod is not on the daemon-reachable TOCTOU surface that SEC-1 targets today, so the cutover is left as follow-up.Cross-platform
*atlibc syscalls are POSIX-2008, present on every supported Unix target.DirSandboxand all*athelpers remain#[cfg(unix)]; the call sites switch on#[cfg(unix)]to keep the build green.Test plan