Skip to content

tcprewrite: handle malformed and unsupported packets as soft errors#613

Merged
fklassen merged 1 commit intoappneta:masterfrom
GabrielGanne:skip-malformed-unsupported
Mar 15, 2021
Merged

tcprewrite: handle malformed and unsupported packets as soft errors#613
fklassen merged 1 commit intoappneta:masterfrom
GabrielGanne:skip-malformed-unsupported

Conversation

@GabrielGanne
Copy link
Copy Markdown
Contributor

Hi,

This is in response to #611

The ticket issue is caused by the packet being rewritten to be
unsupported (fragmented IPv6 packet). The issue would be the same
for malformed packets however.

The current behavior is to fail quite brutally by stopping all processing
right away. I propose to just skip those packets instead.

Best regards,

Instead of hard failing on malformed packets, treat them as soft errors
and skip them. This concerns both malformed packets (eg. too short to
contain the expected protocol headers) and unsupported packets (eg.
fragmented IPv6 packets).

This is a partial fix for appneta#611

Signed-off-by: Gabriel Ganne <gabriel.ganne@gmail.com>
Copy link
Copy Markdown
Member

@fklassen fklassen left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. Thanks Gabriel.

@fklassen
Copy link
Copy Markdown
Member

I'm not certain I am comfortable with accepting this change. It usually means that the packet capture is corrupt. I have had lots of CVE's opened because Tcpreplay was processing invalid packets and accessing uninitialized memory. This change may open the door for more bug reports.

I had a closer look, and it seems worth the risk. This is great to have, enabling edits on short caplen captures. I suspect that we may see some bugs come out of this at some point, but for now I cannot find any.

Thanks again @GabrielGanne for a great contribution.

@fklassen fklassen merged commit 0a03f18 into appneta:master Mar 15, 2021
@GabrielGanne GabrielGanne deleted the skip-malformed-unsupported branch October 14, 2024 11:50
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.

2 participants