Skip to content

docs(design): SEC-1.q2 receiver-side deletion sandbox follow-up design - #4729

Merged
oferchen merged 1 commit into
masterfrom
docs/sec-1-q2-receiver-deletion-sandbox-design
May 22, 2026
Merged

oferchen merged 1 commit into
masterfrom
docs/sec-1-q2-receiver-deletion-sandbox-design

Conversation

@oferchen

Copy link
Copy Markdown
Owner

Summary

  • SEC-1.q (PR refactor(engine): DeleteFs trait sandbox refactor + emitter wiring (SEC-1.q) #4728, merged) explicitly deferred the receiver-side wiring: the engine now exposes a sandbox-anchored DeleteFs trait surface and a DeleteEmitter::with_sandbox carrier slot, but the receiver loop in crates/transfer/src/receiver/directory/deletion.rs still calls std::fs::remove_file / remove_dir_all / read_dir directly under --delete. Audit rows Clamp peer protocol advertisements to supported range #5-Add byte-based legacy greeting parser #7 in docs/audits/sec-1-path-syscall-audit-2026-05-22.md enumerate the open sites.
  • This docs-only PR adds docs/design/sec-1-q2-receiver-deletion-sandbox-2026-05-22.md with the closure options grounded in the actual call site, the SEC-1.r temp_guard / temp_cleanup precedent (PR feat(transfer): thread DirSandbox through temp_guard/temp_cleanup (SEC-1.r) #4723), and the SEC-1.s recursive helper surface.
  • Three options scoped: (A) migrate the receiver to construct a DeleteEmitter for the funnel, (B) swap the three syscalls for fast_io::*_via_sandbox_or_fallback siblings plus a new read_dir_via_sandbox_or_fallback helper, (C) defer behind the SEC-1.p Landlock layer.
  • Recommendation: Option B on effort-vs-risk grounds. ~220 LoC, mechanical, identical-behaviour fallbacks at every helper, mirrors the SEC-1.r threading pattern exactly. Option A is the architecturally correct end state but the planned DDP pipeline (DDP-E1-E5) will retire the legacy loop wholesale, so paying twice for the same transition is not justified. Option C leaves non-Landlock platforms (older Linux kernels, SSH/local transfers, macOS) with no *at coverage.

No code changes; design only. Implementation ships as the follow-up SEC-1.q2 PR.

Test plan

  • Reviewer reads the call-site references in crates/transfer/src/receiver/directory/deletion.rs:115, :157, :159 against the option write-ups.
  • Reviewer confirms the SEC-1.r precedent (crates/transfer/src/temp_guard.rs:147-216) is the right shape to mirror.
  • Reviewer confirms single_component_leaf precondition in crates/fast_io/src/dir_sandbox/at_syscalls.rs:286-303 is correctly characterised.
  • No CI-affecting changes (docs-only).

Captures the receiver-side `--delete` wiring follow-up SEC-1.q (PR #4728)
intentionally deferred. The merged engine-side work added a sandbox-aware
DeleteFs trait surface plus the DeleteEmitter::with_sandbox carrier, but
the receiver loop in crates/transfer/src/receiver/directory/deletion.rs
still calls std::fs::remove_file / remove_dir_all / read_dir directly.

Lays out three options (migrate receiver to DeleteEmitter, swap to
fast_io *_via_sandbox_or_fallback helpers, defer behind Landlock) with
LoC scope, risk, test cost, and cross-platform plan. Recommends Option B
(direct helper swap) on effort-vs-risk grounds and because the SEC-1.r
temp_guard / temp_cleanup PR (#4723) is the established precedent for
exactly this carrier-threading shape.

Closes audit rows #5-#7 in docs/audits/sec-1-path-syscall-audit-2026-05-22.md
once the implementation PR lands. Docs-only.
@github-actions github-actions Bot added the documentation Improvements or additions to documentation label May 22, 2026
@oferchen
oferchen merged commit cdf7cb4 into master May 22, 2026
10 checks passed
@oferchen
oferchen deleted the docs/sec-1-q2-receiver-deletion-sandbox-design branch May 22, 2026 12:19
oferchen added a commit that referenced this pull request Aug 24, 2026
#4729)

Captures the receiver-side `--delete` wiring follow-up SEC-1.q (PR #4728)
intentionally deferred. The merged engine-side work added a sandbox-aware
DeleteFs trait surface plus the DeleteEmitter::with_sandbox carrier, but
the receiver loop in crates/transfer/src/receiver/directory/deletion.rs
still calls std::fs::remove_file / remove_dir_all / read_dir directly.

Lays out three options (migrate receiver to DeleteEmitter, swap to
fast_io *_via_sandbox_or_fallback helpers, defer behind Landlock) with
LoC scope, risk, test cost, and cross-platform plan. Recommends Option B
(direct helper swap) on effort-vs-risk grounds and because the SEC-1.r
temp_guard / temp_cleanup PR (#4723) is the established precedent for
exactly this carrier-threading shape.

Closes audit rows #5-#7 in docs/audits/sec-1-path-syscall-audit-2026-05-22.md
once the implementation PR lands. Docs-only.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements or additions to documentation

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant