fix(toolchain): #273 sandbox containment — explicit trust root for post-install rewrites (+ CI wine cache)#275
Merged
Conversation
…ed through every post-install rewriter - containment_root(cfg.registryDir) resolved once at entry, passed down; never re-derived from payload paths (canonicalizing the payload first dissolves the fence) - per-file fence in patchelf_walk covers interior symlinks AND the binutils sibling walks the entry ownership guard never vetted - entry guard rewritten on the shared predicate: fixes error_code reuse masking failures and raw-string prefix matching without a component boundary; fails closed on unresolvable paths - unit tests pin the incident topology (symlinked payload, dot-dot traversal, sibling string prefix, empty-root fail-closed) - 13_toolchain_pin.sh symlink seed kept as a live canary (now harmless) - CI: cache wine .deb closure in cross-build workflow
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.
Fixes #273
沙盒围栏:显式信任根,非启发式设计
整体评估发现入口层自 #109 起已有 ownership guard 与内容指纹 marker——事故主向量在当前 main 已被入口挡住(损坏应发生于更早版本)。本 PR 修复其三处残余缺口,并把围栏下沉为架构级契约:
<registry>-evil兄弟目录能穿过starts_with。设计
cfg.registryDir(系统一等事实),containment_root()在入口 canonical 化一次,作为显式参数穿透到所有改写者(patchelf_walk逐文件、fixup_gcc_specs/fixup_clang_cfg入口)——绝不从 payload 路径反推(先 canonical 化 payload 会把恶意符号链接解析掉,围栏沦为恒真式)。escapes_containment独立导出,单测复刻事故拓扑(symlink payload、..穿越、兄弟前缀、空根)。13_toolchain_pin.sh的 symlink 种子有意保留为真实环境金丝雀(围栏后无害;若围栏回归,机器上的 gcc 会立刻大声坏掉)。附带
验证