Skip to content

feat: add linux extra readable mounts for cross-mount visibility#62

Open
jy-tan wants to merge 3 commits intomainfrom
extra-readable-mounts
Open

feat: add linux extra readable mounts for cross-mount visibility#62
jy-tan wants to merge 3 commits intomainfrom
extra-readable-mounts

Conversation

@jy-tan
Copy link
Contributor

@jy-tan jy-tan commented Feb 27, 2026

Summary

Implement non-recursive bubblewrap root binds by introducing filesystem.extraReadableMounts. This lets users explicitly expose mount roots (for example /nix and /run) while keeping defaults conservative.

Changes

  • Add new config field filesystem.extraReadableMounts and wire it through config loading/merge, JSON output, and schema generation.
  • Implement Linux mount handling in internal/sandbox/linux_mounts.go:
    • read /proc/self/mountinfo
    • include descendant submounts under each configured root
    • canonicalize paths and skip special mounts (/dev, /proc, /tmp) to avoid conflicts.
  • Apply the expanded mount list to both enforcement layers:
    • bubblewrap read-only binds in internal/sandbox/linux.go
    • Landlock read allow rules in internal/sandbox/linux_landlock.go.
  • Add validation that extraReadableMounts entries are absolute paths (must start with /).
  • Add unit test coverage for config validation/merge/marshal and Linux mountinfo parsing/expansion.
  • Update docs:
    • config docs for extraReadableMounts with a NixOS example
    • troubleshooting guidance on how to choose roots from missing paths (/nix/store/... -> /nix, /run/... -> /run).

Copy link

@cubic-dev-ai cubic-dev-ai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

1 issue found across 11 files

Prompt for AI agents (unresolved issues)

Check if these issues are valid — if so, understand the root cause of each and fix them. If appropriate, use sub-agents to investigate and fix each issue separately.


<file name="internal/sandbox/linux.go">

<violation number="1" location="internal/sandbox/linux.go:655">
P2: Appending `extraReadableMountPaths` last can cause explicit mount roots to be skipped when earlier child paths mark the root as already bound. Process extra mount roots first so their bind is not dropped by intermediary-dir bookkeeping.</violation>
</file>

Reply with feedback, questions, or to request a fix. Tag @cubic-dev-ai to re-run a review.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant