Repository navigation
Batch: seven sandbox, compiler and CI hardening PRs from @adilalperenciftci, with follow-ups - #3456
Merged
Merged
Conversation
Signed-off-by: Adil Alperen Çiftci <adilalperenciftci@users.noreply.github.com>
Signed-off-by: Adil Alperen Çiftci <adilalperenciftci@users.noreply.github.com>
Signed-off-by: Adil Alperen Çiftci <adilalperenciftci@users.noreply.github.com>
Signed-off-by: Adil Alperen Çiftci <adilalperenciftci@users.noreply.github.com>
Signed-off-by: Adil Alperen Çiftci <adilalperenciftci@users.noreply.github.com>
Signed-off-by: Adil Alperen Çiftci <adilalperenciftci@users.noreply.github.com>
Signed-off-by: Adil Alperen Çiftci <adilalperenciftci@users.noreply.github.com>
The execve wrapper rebuilt the child's sandbox controls from live environ, which the contained process can edit (setenv a grant file of its own, unsetenv the shm, then execve). Snapshot LD_PRELOAD, AETHER_SANDBOX_* and AETHER_CAPSICUM once in sandbox_init into static bounded buffers and merge from the snapshot; if they do not fit, execve fails closed with EPERM. Adds a tamper case to sandbox_exec_env_inherit. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
pos += snprintf(...) could pass buf[8192] (snprintf returns the would-be length), so the following (pos+1)-byte write read past the stack buffer. Fail the spawn (-1) when an entry does not fit, on Linux and BSD. Adds sandbox_grant_overflow. ATOMIC_VAR_INIT is deprecated since C17. docs: note #3436 and #3440 behaviour in containment-sandbox.md. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This was referenced Oct 29, 2026
Collaborator
Author
|
Full 🤖 Generated with Claude Code |
Contributor
|
The only red job is |
paul-hammant
pushed a commit
to paul-hammant/aether-fork
that referenced
this pull request
Oct 30, 2026
Signed-off-by: Adil Alperen Çiftci <adilalperenciftci@users.noreply.github.com> Rebased onto main after aether-lang-dev#3456; conflicts with e18798f resolved in favour of aether_sandbox_grants.h. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Credit: the work in this batch is @adilalperenciftci's: seven well-tested hardening fixes across the compiler's capability gates, the sandbox runtime and CI, each closing a real gap. Thank you. Two small follow-ups of ours sit on top; the commits carry his authorship.
Seven PRs by @adilalperenciftci, reviewed and cherry-picked as one batch with the author kept on each commit, plus two follow-up commits of ours. #3441 is held out: it conflicts with #3334's per-thread grant levels (#2955), see the comment there.
--emit=libgates module families by name orname.prefix; addsstd.file,std.dir,std.udp,std.dl,contrib.host, andstd.http.*/std.os.*childrenos.systemunder@no_oshide/sealchecked before the DSL receiver fallback, and applied inside trailing closures.aein the repo uses themtests/freebsd/run.shO_EXCL, 0600, retried)execvewith an explicit environment keeps the sandbox controlsOur follow-ups:
environ, which the contained process can edit (setenv a grant file of its own, unsetenv the shm, then execve). They are now snapshotted once in the constructor into fixed buffers, and execve rebuilds the child's controls from the snapshot (no malloc; an overflowing snapshot denies). Newtampercase insandbox_exec_env_inherit; it fails on 0f58cf8.spawn_sandboxed_{linux,bsd}.cadvancedposby snprintf's would-be length, so an entry starting under the 8000-byte cut-off could takepospast the 8192-byte buffer, and the shm write then read past it. It now denies the spawn.ATOMIC_VAR_INIT(deprecated since C17) dropped. Two lines in docs/containment-sandbox.md (fail-closed grant sources; onlyexecveis interposed, notexecvp/posix_spawn). New testsandbox_grant_overflow(an entry crossing 8192); it fails with the old serialiser.Verification:
make test633 passed; emit_lib_banned 12/12, emit_lib_with_capability 35/35, hide_seal_directives 19/19, effect_tags pass. The sandbox tests skip on macOS.make cion the final tree is still running. I'll add its result here.spawn_sandboxed_bsd.c's hunk is identical to the Linux one, and ci: run FreeBSD containment tests #3434 makes this PR's CI run the FreeBSD tests.Follow-ups noted, not in this PR: the trust anchor's own pathLenConstraint (#3432); still-ungated capability-bearing modules under
--emit=lib(std.zip/std.tarextract,std.ipc,contrib.sqlite,std.sandbox); effect classification doesn't knowudp,dlor import aliases; a grant file the contained process can write remains writable (prefer the shm source).When this merges I'll close #3428, #3431, #3433, #3434, #3436, #3440 and #3444 pointing here.
🤖 Generated with Claude Code