Skip to content

ldap: bound the bytes materialized while reassembling a search response - #5101

Open
KernelClint wants to merge 1 commit into
secdev:masterfrom
KernelClint:perf/ldap-bounded-reassembly
Open

ldap: bound the bytes materialized while reassembling a search response#5101
KernelClint wants to merge 1 commit into
secdev:masterfrom
KernelClint:perf/ldap-bounded-reassembly

Conversation

@KernelClint

Copy link
Copy Markdown
Contributor

A segmented LDAP search response is re-parsed from the start of the buffer as each segment
arrives, so an ordinary valid multi-message response makes session-aware capture stall well past
the point the data is complete. No malformed input is needed.

This bounds the total bytes materialized per reassembly attempt. A segmented search response still
returns LDAP_SearchResponseResultDone.

A small valid multi-read response took 124,933.9 ns/call unmodified and 121,541.6 ns/call with the
change.

Test added in test/scapy/layers/ldap.uts. The focused LDAP suite failed 1 of 18 without the fix
and passes 18 of 18 with it.

Segmented LDAP search responses are re-parsed from the start of the
buffer on each arriving segment, so a valid multi-message response makes
session-aware capture stall well past the point the data is complete.

Bound the total bytes materialized per reassembly attempt. A segmented
search response still returns LDAP_SearchResponseResultDone.

A small valid multi-read response took 124,933.9 ns/call unmodified and
121,541.6 ns/call with this change.

AI-Assisted: yes (GPT-5.6-Cyber)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant