Skip to content

Tracker: pseudo-filesystem audit R5-R11 #32

Description

@vyskocilm

Tracker for the remaining pseudo-filesystem recommendations, migrated from TODO.md, which is being retired in favour of issues. Full report: .claude/design/PSEUDOFS-AUDIT.md, including the accepted gaps and the full test list (§Disposition).

R1 and R2 — the two structural defects — are fixed (RULE 4 and RULE 2 in internal/policy/validate.go, with internal/policy/testdata/refusals.txt as the review artifact). R3 and R4 are #29. What is left:

  • R5snug doctor should read and report the host hardening snug silently depends on: kptr_restrict, dmesg_restrict, perf_event_paranoid, ptrace_scope, unprivileged_bpf_disabled. It checks none today. ptrace_scope in particular is what stands between two co-resident payloads (see pidfd_getfd is not denied by the seccomp filter #23), and a host where it is 0 is exactly the container case key feature 3 says snug must work in.
  • R6 — refuse a rw grant at or under /sys. Cgroup delegation gives kill/freeze over out-of-sandbox processes. Keep ro /sys expressible.
  • R7 — route the hard-coded NOT-GRANTED literal in cmd/snug/dryrun.go through covered(); today it can print ro /sys and "never mounted" on one screen, in the one artifact a human trusts. Verify first: the sibling of this bug was fixed for ~/.config/gh when authored() was introduced, so part of R7 may already be closed.
  • R8 — bound the /dev, /dev/shm, /tmp and $HOME tmpfs with size=. Host-RAM-exhaustion DoS; the engine's own containers already do this.
  • R9 — batched doc corrections: INDEX §5.2's /dev enumeration and §5.3's fingerprint claim, the phantom [profile.sysfs], N5's side-channel list, @podman-socket's host-resource claim, and the time-namespace fact for CLAUDE.md.
  • R10 — opt-in --new-session for non-interactive payloads, closing the /dev/tty OSC-52 channel to the operator's terminal. Do not filter escape sequences. Note snug already passes --new-session conditionally, on /proc/sys/dev/tty/legacy_tiocsti (internal/policy/bwrap.go:133) — this is a second, independent reason for the same flag and must not silently merge with the first.
  • R11SECCOMP_RET_ERRNO on non-native architectures instead of ALLOW. The x86_64 i386-compat path falls through to ALLOW, so a 32-bit binary bypasses the filter; it is the only remaining native route toward a writable remount. Closing it outright breaks 32-bit binaries, and that trade was taken deliberately and is documented in internal/sandbox/seccomp.go — this item is about returning an errno rather than allowing, which is a different trade. (clone3 and the x32 ABI were the other two gaps and are closed.)

Standing note

Every confirmed finding becomes a named regression test with a positive control before its fix lands. Several existing pseudo-fs tests fail the pasta.avx2 "can this test ever fail?" check and are named in the report.

The audit's workflow could not spawn a redteam-typed phase, so its findings rest on research agents' live probing plus lead re-verification. A dedicated redteam pass over this surface is still worth running before a fix lands.

Metadata

Metadata

Assignees

No one assigned

    Labels

    area:policyPolicy model, profiles, resolution, bwrap argvsev:lowConfirmed finding, low severity or papercut

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions