Skip to content

fix(binary-identity): resolve clock ticks without rustix auxv init - #6076

Queued
EmilienM wants to merge 1 commit into
ai-openshell:mainfrom
EmilienM:fix/6069-clock-ticks-auxv/EmilienM
Queued

EmilienM wants to merge 1 commit into
ai-openshell:mainfrom
EmilienM:fix/6069-clock-ticks-auxv/EmilienM

Conversation

@EmilienM

Copy link
Copy Markdown
Contributor

Summary

Every mediated connect() in a sandbox answered EIO on kernels without PR_GET_AUXV (Linux < 6.4, e.g. RHEL 9's 5.14). start_time_ms called rustix's clock_ticks_per_second, whose auxv initialisation panics on the broker thread when prctl(PR_GET_AUXV) is missing and /proc/self/auxv is unreadable inside the sandbox. The regression came in with #5251 and first shipped in 0.1.10. The tick rate now comes from sysconf(_SC_CLK_TCK) with the Linux ABI constant as a fallback, and the rustix dependency is gone from the crate.

Related Issue

Closes #6069

Changes

Release Notes

Fixed sandbox egress failing with EIO on kernels older than 6.4, such as RHEL 9 / RHCOS 9.6 nodes. The network broker no longer panics during process-identity resolution, so mediated connects and the policy telemetry they produce work again on those kernels.

Testing

  • Checks appropriate to the affected code and behavior pass
  • Unit tests added/updated
  • E2E tests added/updated

How the fix was verified against the bug:

  • Reproduction: with the old rustix lookup emulated inside the regression fixture (same prctl(PR_GET_AUXV) then /proc/self/auxv fallback and unwrap), the child panics on the same unwrap from the Kubernetes sandbox egress on 0.1.10 fails EIO on kernel < 6.4: every mediated connect() panics the network broker in rustix auxv init (regression from 0.1.9) #6069 stack trace and the test fails. With this change, the same child resolves a start time and passes. The fixture checks that /proc/self/auxv is actually unreadable and reports exercised vs skipped, so it cannot pass vacuously.
  • cargo test -p openshell-binary-identity: 23 tests plus the two fixture halves green, also under RUST_TEST_THREADS=1.
  • Podman conformance suite (77 tests) against gateway/supervisor/sandbox images built from this branch: all passed, including the network-egress, policy-advisor draft-rule, and L7 suites that exercise the broker identity path. transparent_tcp fails on this host identically on clean origin/main (rootless podman DNS for the fixture alias), so it is environmental.
  • Workspace clippy with -D warnings (experimental and perf-harness rows) and an openshell-server test-support compile check pass.

Checklist

  • Follows Conventional Commits
  • Commits are signed off (DCO)
  • Architecture docs updated (not applicable)

`start_time_ms` called rustix's `clock_ticks_per_second`, whose auxv
initialisation panics when the kernel lacks `PR_GET_AUXV` (added in
Linux 6.4) and `/proc/self/auxv` cannot be opened as a fallback. Inside
the sandbox network broker that is exactly the situation on RHEL 9
nodes (kernel 5.14), so every mediated connect() panicked the
notification handler and was answered EIO, breaking all sandbox egress
since 0.1.10.

Resolve the tick rate with `sysconf(_SC_CLK_TCK)` instead, degrading to
the Linux ABI constant (`USER_HZ` = 100) rather than risking a panic,
and drop the rustix dependency from the crate. Add a regression test
that reproduces the kernel < 6.4 conditions with a seccomp filter
answering `PR_GET_AUXV` with ENOSYS and a Landlock ruleset that denies
`/proc/self/auxv` while keeping `/proc/stat` readable.

Closes ai-openshell#6069

Signed-off-by: Emilien Macchi <emacchi@redhat.com>
@EmilienM

Copy link
Copy Markdown
Contributor Author

@FrostGod please take a look

@guimou

guimou commented Nov 30, 2026

Copy link
Copy Markdown

Independent confirmation of the root cause — and the fix verified locally

We hit #6069 on RHEL CoreOS 9.6 (kernel 5.14.0-570.154.1.el9_6.x86_64) with OpenShell 0.1.10: every mediated connect() is answered EIO, and the workload log shows the network-broker panic at rustix-1.1.6/src/backend/linux_raw/param/auxv.rs:269:22: called Result::unwrap() on an Err value: () (syscall=42), for an allowed host and for policy.local alike. v0.1.11-pre.2 (chart and all three images) reproduces it identically — same panic, same EIO — so this fix is what that class of nodes needs.

At 74651cc3041cf0278de6e6f9f28c6ce254ba8c60 I ran the crate tests and a revert A/B on a different machine (Fedora, kernel 7.3.6, where both fixture controls engage):

From reading rustix 1.1.6: clock_ticks_per_second goes through the panicking init_auxv() (it unwraps after trying PR_GET_AUXV and then /proc/self/auxv), with no non-panicking variant on that path, so removing it from the identity path is the right shape; the USER_HZ = 100 fallback also matches what /proc/<pid>/stat is documented against.

One merge-gate note: "PR Issue Acceptance" is currently red because #6069 carries state:triage-needed rather than state:accepted, which community PRs require.

We will re-run our 5.14-node egress preflight (an allowed host, policy.local, and the draft-rule check) against the next published build that contains this commit and report the result here.

@TaylorMutch TaylorMutch left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Reviewed the fix against #6069. The sysconf lookup removes the panicking auxv initialization from process identity resolution, and the subprocess regression test covers unavailable PR_GET_AUXV plus denied auxv reads. Required checks pass.

@TaylorMutch
TaylorMutch added this pull request to the merge queue Nov 30, 2026

This branch has not been deployed

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

Labels

None yet

Projects

None yet

3 participants