8ec37ed531684281d66bb4f9ff5253fe0747908b
Two P3 hardening items from the review: a descendant that changes its own process group escapes the deadline's group kill, and could then leak or block the parent. - The deadline path now also sends a pid-targeted SIGKILL to the direct child, so child.wait() is bounded even if the child left the group and the group kill missed it. - The normal-exit path drains stdout and stderr non-blocking instead of read_to_string: the child has exited so its output is already buffered, but an escaped grandchild holding a write end would keep the pipe from EOF and hang a blocking read. The drain is capped so a descendant that keeps writing cannot spin it. first_buffered_line now shares that drain. Verified: a probe child whose grandchild setpgid-escapes and holds the pipe returns in 25 ms instead of hanging, and a direct child that escapes and blocks is bounded to the deadline instead of its full sleep.
Description
原始地址 https://github.com/rustdesk/hbb_common
并未做任何修改
只是为了拉取代码方便
701 KiB
0 Stars
1 Watchers
0 Forks
Languages
Rust
100%