Repository navigation
Conversation
Generated-by: Google Antigravity
Reuse FS_IOC_GETFSUUID instead of accepting a shared backing fsid. Reject overlays without an instance UUID while preserving copy-up stability. Replace the synthetic fsid test with an explicit live-mount rejection test. Generated-by: OpenAI Codex
Colafornia
force-pushed
the
fix/sandbox-overlayfs-directory-identity
branch
from
November 15, 2026 11:46
0daa2ef to
0899774
Compare
Colafornia
marked this pull request as ready for review
November 15, 2026 11:47
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.
English
Summary
Preserve workspace directory grants when Linux overlayfs copies a lower-layer directory to the writable upper layer. Creating
.maka-workspace.jsonmust not invalidate the grant used by ACPsession/newand later tools.Refs #6667 and #6815.
Root cause and identity boundary
DirectoryIdentityhashes(volume, ino, birth). Directory copy-up can change birth time while preserving the visible directory inode. Omit birth only for overlayfs, and obtain its instance UUID through the existingFS_IOC_GETFSUUIDpath.A nonzero
f_fsidis insufficient: withuuid=off/null, overlayfs returns the backing filesystem's fsid. Independent overlays can then share both fsid and a lower directory's inode. The initial PR accepted one overlay's grant after the same path was mounted with another upper directory. This revision removes overlayfs from the fsid branch and rejects mounts that cannot expose an instance UUID. It also removes the synthetic statfs helper and its obsolete test.The earlier claim that overlayfs always rejects
FS_IOC_GETFSUUID, or thatuuid=offimplies a zero fsid, was incorrect on the tested kernel. The ioctl returns a persistent instance UUID withuuid=on/auto;uuid=off/nullreturnsENOTTY, mapped toUnsupported.Verification
Verified at
0899774dcd68e904154cfb4f32cd433a72ea41fa(based onorigin/rust-preview0b1e112aace9cff744a4064f6395b4676576c054):7.2.12-orbstack-00394-gbecdd6130068:cargo clippy --locked -p maka-sandbox --all-targets --no-deps -F schemars/uuid1 -- -D warningspassed (0 warnings), andcargo test --locked -p maka-sandbox --lib -F schemars/uuid1passed (10 passed, 2 explicitly ignored live-mount tests).CAP_SYS_ADMIN, tmpfs-backed overlays) withMAKA_TEST_OVERLAYFS_DIRand-- --ignored --nocapture:uuid=on(captured_grant_survives_linux_overlayfs_copy_up) anduuid=off(captured_grant_rejects_linux_overlayfs_without_uuid) both passed. (Additionaluuid=auto/uuid=nullmounts and the separatemaka-fs-tools::directory::openharness verifying persistence across unmount/remount and cross-instance rejection were verified against the same diff at0daa2ef6dc612300b893f82d27de368144c60509, where the rejection test also failed prior to the fix.)Darwin 27.2.0/ macOS27.2.1):cargo clippy --locked -p maka-sandbox --all-targets --no-deps -F schemars/uuid1 -- -D warningspassed (0 clippy warnings), andcargo test --locked -p maka-sandbox -F schemars/uuid1passed (11 lib tests + 4 integration tests passed).cargo fmt -p maka-sandbox -- --check,node scripts/asf-license-headers.mjs check, andgit diff --checkpassed.The live-mount tests remain explicitly
#[ignore]by default and are not wired into CI. Only Windows tests, Linux bubblewrap integration, and fulljust checkare left to CI.AI use
Google Antigravity authored the initial change. OpenAI Codex verified and fixed the overlay identity collision, updated regression coverage, and ran the pre-rebase Linux checks; Google Antigravity rebased onto
origin/rust-previewand re-ran Linux clippy, unit, live-mount (uuid=on/uuid=off), and macOS checks. Preserve bothGenerated-bytrailers when squashing.Checklist
Does this PR entail a change in behavior?
中文
概述
保持 Linux overlayfs 目录从只读下层复制到可写上层后的工作区授权有效。创建
.maka-workspace.json不应使 ACPsession/new和后续工具使用的目录授权失效。关联 #6667 与 #6815。
根因与身份边界
DirectoryIdentity对(volume, ino, birth)计算哈希。目录复制到上层时,可见的 inode 保持不变,但创建时间可能改变。因此仅对 overlayfs 省略创建时间,并通过已有的FS_IOC_GETFSUUID路径获取实例 UUID。非零
f_fsid不足以证明实例身份:uuid=off/null下,overlayfs 返回底层文件系统的 fsid。不同 overlay 实例可能同时共享这个 fsid 和下层目录的 inode。初版 PR 在同一路径换挂另一个上层目录后,仍接受原实例的授权。本次修订移除 overlayfs 的 fsid 分支,拒绝无法提供实例 UUID 的挂载,并删除合成 statfs 测试及其专用辅助函数。此前关于 overlayfs 总是拒绝
FS_IOC_GETFSUUID、或uuid=off意味着 fsid 为零的描述,在本次内核实测中均不成立。uuid=on/auto时 ioctl 返回持久化的实例 UUID;uuid=off/null时返回ENOTTY,映射为Unsupported。验证
验证提交:
0899774dcd68e904154cfb4f32cd433a72ea41fa(基于origin/rust-preview0b1e112aace9cff744a4064f6395b4676576c054):7.2.12-orbstack-00394-gbecdd6130068:cargo clippy --locked -p maka-sandbox --all-targets --no-deps -F schemars/uuid1 -- -D warnings通过(0 告警),cargo test --locked -p maka-sandbox --lib -F schemars/uuid1通过(10 项通过,2 项真实挂载测试显式忽略)。CAP_SYS_ADMIN的一次性 Docker 容器内用 tmpfs 支撑 overlay 挂载,通过MAKA_TEST_OVERLAYFS_DIR和-- --ignored --nocapture显式运行真实挂载测试:uuid=on(captured_grant_survives_linux_overlayfs_copy_up)与uuid=off(captured_grant_rejects_linux_overlayfs_without_uuid)均通过。(其余uuid=auto/uuid=null挂载,以及调用生产DirectoryIdentity与maka-fs-tools::directory::open验证跨卸载重挂持久化与跨实例拒绝的独立验证程序,已在同 diff 的 rebase 前提交0daa2ef6dc612300b893f82d27de368144c60509上通过,且该拒绝测试在修复前复现失败。)Darwin 27.2.0/ macOS27.2.1):cargo clippy --locked -p maka-sandbox --all-targets --no-deps -F schemars/uuid1 -- -D warnings通过(0 clippy 告警),cargo test --locked -p maka-sandbox -F schemars/uuid1通过(11 项单元测试 + 4 项集成测试通过)。cargo fmt -p maka-sandbox -- --check、node scripts/asf-license-headers.mjs check与git diff --check通过。真实挂载测试默认保持显式
#[ignore],尚未接入 CI。仅 Windows 测试、Linux bubblewrap 集成与完整just check由 CI 覆盖。AI 使用
Google Antigravity 编写初版改动;OpenAI Codex 验证并修复 overlay 身份碰撞、更新回归测试并执行 rebase 前 Linux 检查;Google Antigravity 将分支 rebase 至
origin/rust-preview并重跑 Linux clippy、单元测试、真实挂载测试(uuid=on/uuid=off)及 macOS 全套检查。Squash 时请保留两个Generated-bytrailers。审查清单
本 PR 是否带来行为变更?