Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Merged
merged 1 commit into from
Mar 15, 2021

Conversation

GabrielGanne
Copy link
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 <[email protected]>
Copy link
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
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