Repository navigation
bugfix: Shared-dictionary list methods read nodes after releasing the mutex - #2556
Merged
zhuizhuhaomeng merged 1 commit intoNov 28, 2026
Merged
Conversation
zhuizhuhaomeng
marked this pull request as ready for review
November 28, 2026 06:39
zhuizhuhaomeng
deleted the
codex-security/arp_71b31f5dd93b5438e6a5b4e3cbf1cc2c
branch
November 28, 2026 06:54
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 snapshots each shared-list length while the slab mutex still protects its node.
llencopies the current length before unlocking, so concurrent deletion or slab reuse cannot alter its result.Static Verification Checks
Push snapshot precedes unlock (Passed) — ngx_http_lua_shdict_push_helper copies the incremented length before unlocking and returns the local snapshot, closing the node-reuse attack path.
Llen snapshot precedes unlock (Passed) — ngx_http_lua_shdict_llen snapshots sd->value_len under the mutex and returns the local value, closing the concurrent reuse attack path.
Defensive error avoids reuse (Passed) — ngx_http_lua_shdict_pop_helper snapshots invalid length metadata before unlocking, closing the sibling post-unlock dereference path.
List behavior remains intact (Passed) — t/145-shdict-list.t asserts sequential push lengths, list queries, and left/right ordering, protecting legitimate list behavior.
Finding:
acf_eab641d0bb1de3cd732728bac6fa0a70Patch:
arp_71b31f5dd93b5438e6a5b4e3cbf1cc2cBase commit:
a7733460bc1052e7eedb5240dfbc1cdb98527950Patch SHA-256:
0255b40a73a44aabca9903cc86a7b873a85a7e00218cff493ca3d2b7524d36e3