sessions: drop the reassembly minimum when the buffer start moves - #5182
Open
KernelClint wants to merge 1 commit into
Open
KernelClint wants to merge 1 commit into
KernelClint wants to merge 1 commit into
Conversation
Fixes a regression introduced in secdev#5101. AI-Assisted: yes (gpt-5.6-sol)
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #5182 +/- ##
===========================================
- Coverage 80.35% 47.33% -33.03%
===========================================
Files 374 375 +1
Lines 97578 97609 +31
===========================================
- Hits 78411 46204 -32207
- Misses 19167 51405 +32238
🚀 New features to boost your workflow:
|
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.
A complete LDAP bind is dropped if its first segment arrives last. No error, no
Rawlayer — itnever reaches the caller.
#5101 records the declared message length (
scapy/layers/ldap.py:1111) soTCPSessionskipsre-parsing until the buffer is that long (
scapy/sessions.py:392). The count starts at thebuffer's beginning. A segment belonging before everything received so far makes
StringBufferprepend and move that beginning (
scapy/sessions.py:144), so the count points nowhere. Nothingclears it, and the session waits for a length it can never reach.
noffalready tracks the start, so no new state is needed:Clearing the count unconditionally would restore the quadratic cost #5101 removed, so we clear it
only when the start actually moved. In-order traffic is unaffected. The buffer at
scapy/sessions.py:312appends without a sequence number, so its start moves once, before anycount exists.
Test in
ldap.uts: a bind whose first four bytes arrive last.