GeezerVisonThe World Wide Web, restored to 800 pixels of glory. | |
| Home|About|Gaming cabinet|Archives|How it works|Starter sites | |
GeezerVison is showing github.com — Auto-port 4.1: Fix HpackDynamicTable losing entries when filled to capacity by netty-project-bot · Pull Request #17846 · netty/netty Conversation
Contributor
Auto-port of #17831 to 4.1 Motivation: HpackDynamicTable stores its entries in a circular array sized This is reachable with RFC 7541-valid input that Netty's own HpackEncoder Modification: Allocate one extra slot (maxEntries + 1) so the circular queue can hold Result: The dynamic table keeps all entries reachable when filled to capacity. Discovered by fuzzing. 🤖 Generated with Claude Code
Sorry, something went wrong. Uh oh!
There was an error while loading. Please reload this page. All reactionsMotivation:
HpackDynamicTable stores its entries in a circular array sized
ceil(capacity / 32) (HEADER_ENTRY_OVERHEAD is 32, the size of an entry
with an
empty name and value). A circular queue that uses head == tail to mark
the
empty state can only hold (array length - 1) elements, so when the table
is
filled with exactly ceil(capacity / 32) minimum-sized entries (total
size ==
capacity, which fits without eviction), head wraps onto tail and
length()
returns 0. The just-added entries become unreachable, and a subsequent
indexed
reference to them fails the whole header block with a COMPRESSION_ERROR
connection error ("HPACK - illegal index value").
This is reachable with RFC 7541-valid input that Netty's own
HpackEncoder
produces: with the default 4096-byte table it triggers after 128 empty
name/value headers added with incremental indexing, and with a small
table size
(e.g. 32) after a single entry.
Modification:
Allocate one extra slot (maxEntries + 1) so the circular queue can hold
maxEntries entries while keeping head != tail.
Result:
The dynamic table keeps all entries reachable when filled to capacity.
Discovered by fuzzing.
(cherry picked from commit b2df25a)
|
There was an error while loading. Please reload this page.
✅ All tests passed ✅🏷️ Commit: ab46219 Learn more about TestLens at testlens.app/docs. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
…pacity (netty#17846) Auto-port of netty#17831 to 4.1 Cherry-picked commit: b2df25a --- Motivation: HpackDynamicTable stores its entries in a circular array sized ceil(capacity / 32) (HEADER_ENTRY_OVERHEAD is 32, the size of an entry with an empty name and value). A circular queue that uses head == tail to mark the empty state can only hold (array length - 1) elements, so when the table is filled with exactly ceil(capacity / 32) minimum-sized entries (total size == capacity, which fits without eviction), head wraps onto tail and length() returns 0. The just-added entries become unreachable, and a subsequent indexed reference to them fails the whole header block with a COMPRESSION_ERROR connection error ("HPACK - illegal index value"). This is reachable with RFC 7541-valid input that Netty's own HpackEncoder produces: with the default 4096-byte table it triggers after 128 empty name/value headers added with incremental indexing, and with a small table size (e.g. 32) after a single entry. Modification: Allocate one extra slot (maxEntries + 1) so the circular queue can hold maxEntries entries while keeping head != tail. Result: The dynamic table keeps all entries reachable when filled to capacity. Discovered by fuzzing. Co-authored-by: Jonas Konrad <[email protected]>
There was an error while loading. Please reload this page.
Successfully merging this pull request may close these issues.
There was an error while loading. Please reload this page.