Repository navigation
fix: 4 high-priority correctness bugs - #5
Merged
Merged
Conversation
Module maturity map, correctness bugs (session bwrap bind, gui --web, session --zram, herd stop/scale IPC), containment gaps (no caps/seccomp/ cgroup 8000 s, unconditional /usr RO bind, proot RW downgrade), distribution gap (crush can't self-provision through pkgx), and hygiene items.
session.rs bwrap bind: added SandboxProfile.binds_at_path for path-redirect binds (src != dest). session_start/session_exec now pass the overlay mount through the profile instead of appending --bind AFTER sandboxed_command()'s -- separator, where bwrap never saw it. gui --web: removed the no-op flag (cmd_gui had _web: bool, silently discarded). VNC server still works via --vnc-port. session --zram: removed the no-op flag (use_zram was recorded in SessionConfig but no zram device was ever provisioned). --tmpfs still works. herd stop/scale IPC (BUCKETS-12): herd deploy writes deploy.pid; herd stop reads it and signals SIGTERM to the deploy process (whose existing handler triggers clean shutdown + replica kill + state cleanup). herd scale writes desired_replicas; run_reconciler polls it each tick and calls scale(). 96/96 tests pass (was 95, +1 for binds_at_path regression test). cargo doc: 9 pre-existing warnings (unclosed HTML tags), 0 new.
(1) HIGH - regression test now asserts binds_at_path --bind precedes the
-- separator (the ordering IS the original defect; the old test only
checked flag presence + src/dest, so it would pass if the loop regressed
below --).
(2) HIGH - herd stop now validates deploy.pid via /proc/<pid>/cmdline
(is_herd_deploy_pid) before signalling, so a stale pidfile with a
recycled PID can't kill an unrelated process. Stale/absent pidfile falls
through to the direct replica-kill path. Refactored the force-remove into
force_remove_herd() + read_deploy_pid() helpers.
(3) LOW - upper_is_zram documented as back-compat (always false; the --zram
flag it came from was a no-op). Kept, not removed, per the back-compat
rationale.
96/96 tests pass, no new compile warnings.
Merge master's BUCKETS-17 (fail-closed bwrap + zandbox sandbox hardening) and BUCKETS-14 (herd Unix-socket IPC) into PR #5's 4 high-priority fixes. Rule applied: master's sandbox behaviour wins; no fix is kept where master already covers it; no two mechanisms for the same job. Per fix: - F1 session bwrap bind ordering: DROPPED — already on master. BUCKETS-17 introduced SandboxProfile.binds (BindMount{source,dest,writable}), emitted by build_bwrap_args before the `--` separator, used by both session_start and session_exec via session_exec_profile. Covered by custom_binds_come_before_separator, session_exec_binds_precede_separator and proot_custom_binds_use_dest. The PR's binds_at_path field, its emitters and its test were superseded and removed. - F2 gui --web no-op flag: KEPT — removed the flag from the Gui command, the match arm and cmd_gui's discarded _web parameter. - F3 session --zram no-op flag: KEPT — removed the flag from session start (session_start drops its use_zram param; backing_desc no longer claims zram; help text + README synopsis updated). SessionConfig.upper_is_zram kept as documented back-compat: always written false, only read for `session list` display. Master's BUCKETS-16 --flare zram build-cache flag is untouched. - F4 herd stop/scale deploy reachability: DROPPED — already on master. BUCKETS-14's control-socket IPC (send_control Stop/Scale, with a state.json SIGTERM fallback for orphaned herds) reaches the deploy process for both stop and scale. The PR's deploy.pid + desired_replicas file-polling mechanism and its helpers (is_herd_deploy_pid, read_deploy_pid, force_remove_herd, poll_desired_replicas) removed. Verified: cargo build clean (no warnings); 137-test set identical to master's (133 passed, 1 pre-existing environmental failure — sandbox::live::timeout_kills_whole_tree false-positives on an unrelated session's `sleep 60` poll loop and fails identically on pristine origin/master); cargo fmt --check deviations identical to master's.
- session.rs module doc (Backing stores): remove the zram bullet — it advertised the --zram flag removed by this PR. upper_is_zram field comment untouched (documented back-compat). - docs/GAPS_AND_OPPORTUNITIES.md: add dated status note (2026-11-17) and mark each resolved item in place, one line each — items 1-4 (session bwrap bind ordering fixed on master by BUCKETS-17; gui --web and session --zram removed in this PR; herd stop/scale IPC fixed on master by BUCKETS-14), plus the three maturity-map rows restating them. Audit body unchanged; all other items untouched. Docs-only; cargo build stays at 0 warnings.
nixpt
marked this pull request as ready for review
November 17, 2026 07:06
This was referenced Nov 17, 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.
Summary
Fixes the 4 highest-impact gaps identified in docs/GAPS_AND_OPPORTUNITIES.md.
Test results
Files changed