Repository navigation
bugfix: Timer-retained coroutines dereference contexts from destroyed requests - #2557
Closed
zhuizhuhaomeng wants to merge 1 commit into
Closed
zhuizhuhaomeng wants to merge 1 commit into
zhuizhuhaomeng wants to merge 1 commit into
Conversation
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.
The patch enforces current-request coroutine ownership and makes the security regression log assertion CI-safe.
ngx_http_lua_get_co_ctxtreats exdata2 as untrusted until its address and Lua state match current request-owned storage.deadfrom status andno co ctx foundfrom resume, closing stale request-pool dereferences.Static Verification Checks
Current request ownership (Passed) — Static inspection of ngx_http_lua_get_co_ctx confirms current-request pointer membership and Lua-state identity, closing stale and reused-address attack paths.
Safe foreign rejection (Passed) — Static inspection of ngx_http_lua_coroutine_status and ngx_http_lua_coroutine_resume confirms foreign threads preserve documented dead and no-context rejection behavior.
Local coroutine compatibility (Passed) — TEST 3 in t/197-coroutine-request-cleanup.t asserts timer-local coroutines resume successfully, protecting legitimate same-request coroutine behavior.
Precise log extraction (Passed) — Static inspection of t/197-coroutine-request-cleanup.t confirms token extraction excludes CI context suffixes while wrong values still violate exact expected output.
Fallback lookup compatibility (Passed) — Static inspection of ngx_http_lua_get_co_ctx confirms the non-exdata2 branch retains its existing request-local lookup behavior.
Finding:
acf_8c793d665baac688a369fdd85d8ccc33Patch:
arp_a1d6db1ea7c0efdee40e8fc682073dd3Base commit:
a7733460bc1052e7eedb5240dfbc1cdb98527950Patch SHA-256:
e0946f8bf577433fdb4452a5d45afd97c87b34405da6488d70228d0d9e653093