Skip to content

fix: CI green on both runners: localhost on FHS Linux, the macOS denials window - #144

Merged
sigma merged 4 commits into
mainfrom
diag/142
Oct 6, 2026
Merged

sigma merged 4 commits into
mainfrom
diag/142

Conversation

@sigma

@sigma sigma commented Oct 6, 2026 •

Copy link
Copy Markdown
Member

Fixes #148. Fixes #142.

P-open-bypass on Ubuntu (#148). The Linux FHS floor granted nothing under /etc but the loader's files. So a confined client honouring NO_PROXY=localhost could not resolve localhost: glibc, unable to read /etc/hosts, fell through to a nameserver an FHS host does not run. The floor now grants /etc/hosts, and nothing more of the resolver's configuration, and §8.2 says so. Measured in a Debian container on shirka: the row fails as in CI without the grant and passes with it.

P-denial-tree on macos-15 (#142). The command explain --run prints missed the run's denial. The unified log stamped it at 10:17:51.948, and the window began at 10:17:52, the second of the record's launch, which is stamped before the fork. The window now reaches five seconds past each end, and §14.2 says so. The row's outside half now looks back over a reach of its own, so a window cut wrongly fails the row instead of reading as a setup failure.

Also in this PR:

  • Diagnostics for P-denial-tree. shell no longer reads a failed command as empty output. A launch that never ran the probe is a setup failure. When the wait times out, the message shows what the probe reported and what the log showed.
  • allowed_and_fragment_names_pass_through_and_set_values_win_over_the_floor assumed RUSTUP_HOME was absent from the test's own environment, and CI runners set it. It now removes the variable on the child's command.

Filed from this work: #146, #147, #149.

@sigma sigma changed the title fix: P-denial-tree says why the log never showed its denial fix: the macOS denials window misses denials the log stamps early Oct 6, 2026
sigma added 4 commits October 6, 2026 13:44
`P-open-bypass` failed on `ubuntu-24.04`: the leg that bypasses the
proxy could not resolve `localhost`. The FHS floor granted nothing under
`/etc` but the loader's files, so glibc, unable to read `/etc/hosts`,
fell through to a nameserver on `127.0.0.1:53` that an FHS host does not
run. macOS resolves through `mDNSResponder` and NixOS through `nsncd`'s
socket, which is why only Ubuntu showed it.

`NO_PROXY` names `localhost` and playpen sets it, so resolving that name
is something playpen's own environment promises. `/etc/hosts` is
granted, and nothing more of the resolver's configuration: the row
asserts `localhost` and nothing would assert the rest. §8.2 says so.

Measured on an FHS userland (Debian, in a container on a Linux host):
the row fails as in CI without the grant and passes with it, with the
whole suite green. Also green on NixOS and macOS.

Fixes #148.
A `macos-15` runner fails the row intermittently: twice on d209af4, then
it passed on a third attempt with the same image, and it passes on macOS
26. Each failure waits the full 30s for a denial the log never shows. The
playpen code it drives has not changed since it last passed in CI, so the
cause has to be measured on the runner. The harness was hiding what would
say:

**`shell` read a failed command as empty output.** A `log show` that
could not run printed nothing, and the row polled that nothing to its
deadline and reported it as a denial the log never showed. A command that
fails is now an error carrying its status and stderr, and a harness
self-check holds it there, spelled so the command's own text cannot pass
it. The poll still retries a failed `log show` until the deadline, and a
failure of the command `explain` printed is the row's to fail, as before.

**A launch that never ran the probe was polled for a denial too.** The
shell's `; true` makes any other exit playpen's own, so a failed launch is
now a setup failure with playpen's stderr, decided before the log is read.

**The timeout said nothing about what was seen.** It now carries what the
probe reported, which tells a read that was never denied from a denial
never logged, the last answer of the by-path query, and a query by the
decoy's file name over the last five minutes, which tells a denial logged
under another path, operation or time from none at all.

Refs #142.
…absent

`allowed_and_fragment_names_pass_through_and_set_values_win_over_the_floor`
asserts that a fragment name the host lacks does not reach the child, and
took "the host lacks it" from the test process's own environment. A CI
runner's toolchain setup sets `RUSTUP_HOME`, so the test failed on every
runner where it did, and only by luck of ordering on the others: on
`macos-15` at d209af4 it was hidden behind the enforcement suite failing
first. The child's command now removes the name, so the host state the
assertion depends on is the test's own input.

Found while working #142.
`P-denial-tree` failed intermittently on `macos-15` because the command
`explain --run` prints missed the run's denial. With #142's diagnostics
in, a failing runner said exactly where it was: logged at
`10:17:51.948`, while the window started at `10:17:52`, the record's
launch second. The record is stamped before the fork
(`RunRecord::launch`), so the forked probe cannot have been denied
before it. The unified log stamps an entry from its own time base, and on
the runner's VM that disagreed with the wall clock the record reads by
more than the slack the round-down to whole seconds happened to leave.

The window now reaches `LOG_CLOCK_MARGIN_S`, five seconds, past each end.
One sample bounds the skew only from below (52ms), so the margin is
generous rather than measured. A tagged run's predicate matches that run
alone, so it costs `log show` only a little more to read; a pre-tag
record's pid filter admits ten more seconds in which another process
could have held the pid. §14.2 says so, and why.

**The row now guards the window.** Its outside half used to cut its window
from the printed command, so a window too narrow read as a host that
never logged the denial, a setup failure, and that is how #142 hid as an
intermittent runner fault. The outside half now looks back over a reach
of its own (`LOG_LOOKBACK`, by the decoy's unique path), and a window
`explain` cuts wrongly fails the row inside: measured by shifting the
start past the run.

Fixes #142.
@sigma sigma changed the title fix: the macOS denials window misses denials the log stamps early fix: CI green on both runners: localhost on FHS Linux, the macOS denials window Oct 6, 2026
@sigma
sigma marked this pull request as ready for review October 6, 2026 11:55
@sigma
sigma merged commit f0591d7 into main Oct 6, 2026
3 checks passed
@sigma
sigma deleted the diag/142 branch October 6, 2026 11:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

1 participant