Skip to content

[anneal] Add ExecSeal OS containment, staging, and Door 1 - #3968

Open
joshlf wants to merge 1 commit into
joshlf-anneal-cl3b-elaborator-containment-docfrom
joshlf-anneal-cl3b-execseal
Open

joshlf wants to merge 1 commit into
joshlf-anneal-cl3b-elaborator-containment-docfrom
joshlf-anneal-cl3b-execseal

Conversation

@joshlf

@joshlf joshlf commented Nov 20, 2026

Copy link
Copy Markdown
Member

Human review surface

Implement ExecSeal Tier 1 (linux_bwrap) and Tier 2 (linux_landlock_seccomp) OS containment, Door 1 FD-pinned output promotion, ArtifactLedger verification, --allow-unsandboxed-elaboration, Pass 2 SandboxMode::RequireBwrap enforcement (including non-module .ir rejection), sandbox_escape tests, and the aarch64 ExecSeal CI job.

Layer 17 of 19 in the migrated Anneal verification stack under anneal/.

Public Anneal source checkpoint.

Authored by an AI agent acting on joshlf's behalf.

Implement ExecSeal Tier 1 (linux_bwrap) and Tier 2 (linux_landlock_seccomp) OS containment, Door 1 FD-pinned output promotion, ArtifactLedger verification, --allow-unsandboxed-elaboration, Pass 2 SandboxMode::RequireBwrap enforcement (including non-module .ir rejection), sandbox_escape tests, and the aarch64 ExecSeal CI job.

Source: https://github.com/joshlf/anneal/tree/cad10960a7d415acdb1e04198835d32bc25f49fd
Agent-authored-by: AI agent acting on joshlf's behalf
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 20, 2026 •

Copy link
Copy Markdown
Codex Review Summary: ✅ Completed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-20T15:44:11.897959Z 5b9c7a0 PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 5b9c7a0262

ℹ️ About Codex in GitHub

Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

Comment on lines +1986 to +1988
cmd.arg("--bind")
.arg(&policy.rw_out.host)
.arg(&policy.rw_out.child);

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 Badge Cap aggregate writes to host-backed output directories

A hostile elaborator can create and close an arbitrary number of files in the writable host-backed output directory. RLIMIT_FSIZE limits each file individually, while RLIMIT_NOFILE limits only concurrently open descriptors, and Door 1 inspects outputs only after the child exits; therefore a loop creating many files can exhaust the host filesystem or inode quota before the timeout. This affects both Tier 1's host bind and Tier 2's RW_SCRATCH_DIR, so the writable output needs an aggregate quota or bounded backing store.

Useful? React with 👍 / 👎.

Comment on lines +1045 to +1046
let stdout = stdout_thread.join().unwrap_or_default();
let stderr = stderr_thread.join().unwrap_or_default();

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Reap the process group before joining output readers

With --allow-unsandboxed-elaboration, hostile Lean code can fork a descendant that inherits stdout or stderr and then let the direct child exit. try_wait then reports completion, but these unconditional joins wait forever for EOF from the surviving descendant, so the wall-clock deadline is no longer checked and the verification command can hang indefinitely. Kill/reap the isolated process group after direct-child completion, or make pipe draining itself respect the deadline, before joining these threads.

Useful? React with 👍 / 👎.

Comment on lines +774 to +775
let lean_binary_sha256 = sha256_file_deref(&exec_lean, "toolchain")
.map_err(|e| Failure::operational("toolchain", e.message))?;

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Recheck the executable whose digest was admitted

When unpinned Lean is supplied through a shim or wrapper whose --print-prefix contains a distinct bin/lean (for example an elan-style installation), admission now hashes and executes exec_lean, but run_target still performs its final provenance check by hashing self.lean_path(). The wrapper and real executable normally have different digests, so an otherwise successful --allow-unpinned-lean run fails with “unpinned Lean executable changed during run”; conversely, this check does not detect a post-admission replacement of the executable that was actually used. Store and re-hash adm.exec_lean at the accepting boundary.

Useful? React with 👍 / 👎.

@joshlf
joshlf added this pull request to stack #3976 November 20, 2026 17:58

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

Development

Successfully merging this pull request may close these issues.

1 participant