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

[bugfix] Fix access beyond IP layer bounds if packet stops right after it #280

Merged
merged 1 commit into from
Mar 13, 2024

Conversation

fako1024
Copy link
Collaborator

@fako1024 fako1024 commented Mar 13, 2024

Fixed potential out-of-bounds access and added test for the encountered special (invalid) IP packet scenario.

I'm also trying to capture an actual small pcap file on the host in question to get a sample for the E2E tests, but didn't happen again so far... 🙈

Performance is actually slightly better (probably because the hint now is more accurate for everything that happens in the function):

                                                 │ /tmp/old.txt │            /tmp/new.txt            │
                                                 │    sec/op    │   sec/op     vs base               │
Population/0.0.0.0:68->255.255.255.255:67_17_0-4    9.681n ± 1%   9.514n ± 1%  -1.73% (p=0.000 n=25)

Nice catch!

Closes #279

@fako1024 fako1024 added bug Something isn't working critical Issues that should be looked at with priority labels Mar 13, 2024
@fako1024 fako1024 requested a review from els0r March 13, 2024 12:47
@fako1024 fako1024 self-assigned this Mar 13, 2024
@fako1024 fako1024 linked an issue Mar 13, 2024 that may be closed by this pull request
3 tasks
Copy link
Owner

@els0r els0r left a comment

Choose a reason for hiding this comment

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

Thanks for the blazing fast turnaround on this!

@els0r els0r merged commit 1b956cc into main Mar 13, 2024
6 checks passed
@els0r els0r deleted the 279-panic-during-packet-parsing branch March 13, 2024 15:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working critical Issues that should be looked at with priority
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Panic during packet parsing
2 participants