isotp: extend long reassembly buffers in place - #5109
Conversation
AI-Assisted: yes (GPT-5.6-Cyber)
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #5109 +/- ##
=======================================
Coverage 80.59% 80.60%
=======================================
Files 390 390
Lines 96892 96895 +3
=======================================
+ Hits 78094 78098 +4
+ Misses 18798 18797 -1
🚀 New features to boost your workflow:
|
Drops the length conditional and the isinstance branches it required. AI-Assisted: yes (GPT-5.6-Cyber)
|
Yes — you're right, and I've changed it in I'd added the length check to keep the short-message path untouched, but measuring it, that isn't
The two variants are indistinguishable — the spread between repeated runs of the same build is Always using a |
The opt-in software ISO-TP socket reassembles fragmented application messages carried over CAN. A
32-bit First Frame length starts an attacker-sized message at
scapy/contrib/isotp/isotp_soft_socket.py:986-1005,and every valid Consecutive Frame copies the growing immutable receive buffer at
scapy/contrib/isotp/isotp_soft_socket.py:1061-1070.From 131,072 to 1,048,576 application bytes, median receive processing grew from 32.10 ms to
1,206.87 ms, with a 2.06 exponent and a 2.3% noise floor. Patched times were 7.44 ms to 59.91 ms,
with a 0.99 exponent and a 6.3% noise floor.
This change uses a
bytearrayonly for extended-length messages, extends it in place, and convertsonce on completion. The focused regression failed on the unmodified revision and passed with the
patch.