Skip to content

docs(executor,builtins): #881 — three stale/missing comments on the #873 handshake - #887

Merged
caomengxuan666 merged 1 commit into
fix/866-867from
arookieofc/fix-881-873-comment-trio
Oct 19, 2026
Merged

caomengxuan666 merged 1 commit into
fix/866-867from
arookieofc/fix-881-873-comment-trio

Conversation

@arookieofc

Copy link
Copy Markdown
Member

Closes #881. Stacks on #873 (the handshake PR it annotates).

Three non-blocking comment fixes from #873's CR round:

  1. compound_exec.rs direct-spawn arm comment described the retired env mechanism — rewritten for the nonce handshake (no handshake performed => role stays false); the conclusion sentence was still true and is preserved.
  2. consume_background_wrapper_handshake doc gains the semantic-boundary sentence: channel agreement != compound_exec provenance; consequence bounded to the armer's own tree.
  3. child_pre_exec_reset doc records that the in-process role does not cross exec — a wrapper's exec rubash drops the [S9] process ownership: kill does not terminate background shell children (and wait fabricates 128+n); no SIGPIPE for builtin writers #737 cascade (old env marker could propagate; non-propagation is intended hardening and closer to GNU).

Comment-only, zero behavior change; build + fmt clean.

 handshake

- compound_exec.rs direct-spawn arm: the comment still described the old
  env mechanism ('keys off __RUBASH_BACKGROUND_WRAPPER'). The mechanism
  sentence is rewritten for the nonce handshake — the direct spawn arms
  nothing because it performs no handshake, so BACKGROUND_WRAPPER_ROLE
  stays false; the conclusion (directly-exec'd async child survives shell
  exit) is unchanged.
- consume_background_wrapper_handshake doc: add the semantic-boundary
  sentence — a matching nonce pair proves the two channels agree, it does
  not prove the request came from compound_exec's arming site; the
  consequence is bounded to the arming process's own tree.
- child_pre_exec_reset doc: record that the in-process role does not
  cross exec — a wrapper running 'exec rubash' re-images with the role
  cleared, so the #737 PDEATHSIG cascade does not propagate past exec
  (the old env marker could; the non-propagation is both the intended
  hardening and closer to GNU).

Comment-only; zero behavior change.
@github-actions

Copy link
Copy Markdown
Contributor

欢迎!这是你的第一个 PR 🎉 请确认已跑过本地测试套件;CI 通过后维护者会 review。

@caomengxuan666 caomengxuan666 left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

独立评审结论:APPROVE(#881 三件全部达标,纯注释零行为)

评审方式:自建 worktree(fetch fix/866-867 + arookieofc/fix-881-873-comment-trio → worktree add 于 f6e5edb),逐句对照 nonce 握手实现核查后已删树复核。

票面三件逐项核对

① compound_exec.rs 直通路径注释改写 — 达标。 旧 env 机制句("The #737 pdeathsig arm keys off __RUBASH_BACKGROUND_WRAPPER, which is never set here")已删除;结论句 "a directly-exec'd async child survives shell exit, as GNU's does" 逐字保留。新机制句逐条对照代码核实:直通 spawn 点(compound_exec.rs:409-465)确实不设 --internal-bg-wrapper= argv 通道、不设 env nonce(二者只在 wrapper respawn 路径 :534-578 注入),新 rubash 进程 consume_background_wrapper_handshake 走 no-flag 早退分支 → BACKGROUND_WRAPPER_ROLE 保持 false → child_pre_exec_reset 的 role 谓词不成立、跳过 PDEATHSIG arm。因果链与实现一致。

② handshake doc-comment 语义边界句 — 达标。 新增段(kill.rs:2036-2043)"matching pair ≠ compound_exec 来源证明" 与实现吻合:握手仅为双通道等值判断(kill.rs:2058),消费端把 EXPECTED_PARENT 存为自身 pid(:2066-2067,#867 竞态基线,非来源证明);role 的唯一行为消费者是 PDEATHSIG arm,故 "consequence bounded to the arming process's own tree" 陈述精确。"stop ambient forgery" 的定位与 #866 威胁模型文档(kill.rs:1994-2001)一致。

③ exec-cascade 行为变化记录 — 达标。 新增段(kill.rs:2126-2133)技术陈述全部可验证:role 是进程内 static,execve 换镜像后归 false(新镜像 main 再跑握手,无 argv flag 仍早退);旧机制(历史提交确认:std::env::var("__RUBASH_BACKGROUND_WRAPPER") == Ok("1") 探针)确实可经继承的 env 穿透 exec;"GNU 无特殊 child-kill 契约"(指对 exec'd 镜像的子进程无 PDEATHSIG 式常设约定)表述准确。知情注释符合票面要求。

其余核查

  • 零语义变更:对两个文件做 Rust 注释剥离后 token 级 diff 完全一致(含 #866/#867 相关测试在内的全部代码原样),编译等价性由基线绿证得。
  • 越界审计:git diff base..head -- ':(exclude)两文件' 为空;单 commit(f6e5edb6),+25/−4,仅注释行;分支正好骑在当前 base 头上(merge-base == base HEAD)。
  • GPL 红线:新增文字均为原创陈述,GNU 侧仅行号/函数名引用(仓库既有风格),无 GPL 文本搬入。
  • fmt:cargo fmt --check 通过;CI 全绿,MERGEABLE/CLEAN。

非阻塞备忘(不影响本次合并)

  • Closes #881 挂在栈式 base(fix/866-867)上,GitHub 要等 base 链回流 master 才会自动关票——维护者手动关即可。

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.

2 participants