Repository navigation
bugfix: Subprocesses inherit pipe descriptors from unrelated requests - #2558
Merged
zhuizhuhaomeng merged 1 commit intoNov 28, 2026
Merged
Conversation
zhuizhuhaomeng
marked this pull request as ready for review
November 28, 2026 07:16
zhuizhuhaomeng
deleted the
codex-security/arp_0e9db855ff6207950ac7d86408c69390
branch
November 28, 2026 07:20
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.
All subprocess data pipes now close across unrelated execs.
O_CLOEXECatomically whenpipe2is available.ngx_cloexecand fails closed on errors.dup2handling preserves the current child's standard streams and merged-stderr behavior.Static Verification Checks
Descriptor creation protected (Passed) — Runtime checks were not performed; ngx_http_lua_pipe_create statically establishes every data endpoint closes across exec.
All channels use helper (Passed) — ngx_http_lua_ffi_pipe_spawn routes stdin, stdout, and separate stderr creation through the protected helper, closing every cited path.
Child streams remain usable (Passed) — ngx_http_lua_ffi_pipe_spawn dup2 calls retain the current child's standard streams before exec, preserving legitimate subprocess I/O.
Fallback failures close safely (Passed) — ngx_http_lua_pipe_create closes both endpoints and restores errno when either ngx_cloexec call fails, preventing partial exposure.
Regression source covers isolation (Passed) — t/200-pipe-fd-isolation.t asserts prompt EOF with a concurrent helper and verifies stdin, stdout, and stderr remain functional.
Finding:
acf_210c4913d59a9cd9d021853126edafd3Patch:
arp_0e9db855ff6207950ac7d86408c69390Base commit:
5079ce71b15b21729ce3c5a75e98ddd1007fb619Patch SHA-256:
5eb478632a5aa14ef02aa204debeb53cf8686a1c2cdd5dce7c2a3f16cb87a640