-
-
Notifications
You must be signed in to change notification settings - Fork 2.1k
Check added to PcapNg processing #4373
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
Conversation
309dc52
to
a86c368
Compare
a86c368
to
1e5bca1
Compare
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #4373 +/- ##
=======================================
Coverage 82.20% 82.21%
=======================================
Files 353 353
Lines 83529 83607 +78
=======================================
+ Hits 68662 68734 +72
- Misses 14867 14873 +6
|
I apologize for bringing this up here but since it's related to OSS-Fuzz I wonder if it would be OK if I opened google/oss-fuzz#9629 again? |
@evverx I am fine with the proposed PR that loads all layers. However, I will prefer to keep the reports to the Scapy maintainers only. |
Fair enough. I fuzz scapy elsewhere so I don't need access to bug reports on OSS-Fuzz (though it would make it easier to filter out duplicates, comment on issues like #3145 (comment) reproducible by that fuzz target in certain environments only and so on). I'll open a PR without my email address then. |
The others maintainers might have a different opinion. |
I'm personally fine with @evverx having their email there. Two reasons:
|
One test case is small (~100 bytes), while the two others one are big (1k+ bytes). I could try to reduce the big ones if you think that it is worth the effort. |
Not necessarily, that was more a question than a change request to your PR! |
@gpotter2 I managed to strip down the test cases to 12, 100 and 140 bytes. If that's OK for you, I will add the corresponding unit tests. |
FWIW It should be possible to turn on CIFuzz: https://google.github.io/oss-fuzz/getting-started/continuous-integration/. It downloads corpora accumulated by OSS-Fuzz (including test cases that triggered issues in the past) and runs fuzz targets with them. It doesn't catch all the issues but it should be enough to catch most regressions when PRs are opened. Though it looks like OSS-Fuzz is updating the toolchains, interpreters and some other things so I'd wait for them to finish just in case to avoid running into things like google/oss-fuzz#11886. |
using https://google.github.io/oss-fuzz/getting-started/continuous-integration/ It downloads the corpus OSS-Fuzz has accumulated so far (including the test cases that triggered issues in the past) and runs the fuzz target with it. It should help to catch most regressions when PRs are opened. Prompted by secdev#4373.
It was discussed in secdev/scapy#4373 (comment)
(I opened google/oss-fuzz#11912. It should hopefully make the regression test from #4378 a bit more useful) |
When scapy reads pcap/pcapng files it extracts link layer types from headers and tries to match them with classes representing those layers. Those classes are registered in conf.l2types.num2layer when they are imported so if no layers are imported the only known layer is Raw and it isn't very interesting in terms of fuzzing because it just wraps bytes without parsing anything. Apart from populating l2types when the layers are imported they are bound to make it possible for scapy to guess payloads and move from lower layers all the way up. The coverage went from 24% to 39%. It can be bumped further but I think it would be better to roll out those changes gradually. * [scapy] fix indentation Fixes: ```sh projects/scapy/pcap_fuzzer.py:21:3: E111 indentation is not a multiple of 4 projects/scapy/pcap_fuzzer.py:36:3: E111 indentation is not a multiple of 4 projects/scapy/pcap_fuzzer.py:37:3: E111 indentation is not a multiple of 4 projects/scapy/pcap_fuzzer.py:41:3: E111 indentation is not a multiple of 4 ... ``` and makes it easier to change the code using editors expecting Python code to be compliant with PEP 8. [scapy] update the CC list It was discussed in secdev/scapy#4373 (comment)
using https://google.github.io/oss-fuzz/getting-started/continuous-integration/ It downloads the corpus OSS-Fuzz has accumulated so far (including the test cases that triggered issues in the past) and runs the fuzz target with it. It should help to catch most regressions when PRs are opened. Prompted by secdev#4373.
using https://google.github.io/oss-fuzz/getting-started/continuous-integration/ It downloads the corpus OSS-Fuzz has accumulated so far (including the test cases that triggered issues in the past) and runs the fuzz target with it. It should help to catch most regressions when PRs are opened. Prompted by secdev#4373.
using https://google.github.io/oss-fuzz/getting-started/continuous-integration/ It downloads the corpus OSS-Fuzz has accumulated so far (including the test cases that triggered issues in the past) and runs the fuzz target with it. It should help to catch most regressions when PRs are opened. Prompted by secdev#4373.
using https://google.github.io/oss-fuzz/getting-started/continuous-integration/ It downloads the corpus OSS-Fuzz has accumulated so far (including the test cases that triggered issues in the past) and runs the fuzz target with it. It should help to catch most regressions when PRs are opened. Prompted by secdev#4373.
using https://google.github.io/oss-fuzz/getting-started/continuous-integration/ It downloads the corpus OSS-Fuzz has accumulated so far (including the test cases that triggered issues in the past) and runs the fuzz target with it. It should help to catch most regressions when PRs are opened. Prompted by secdev#4373.
using https://google.github.io/oss-fuzz/getting-started/continuous-integration/ It downloads the corpus OSS-Fuzz has accumulated so far (including the test cases that triggered issues in the past) and runs the fuzz target with it. It should help to catch most regressions when PRs are opened. Prompted by secdev#4373.
using https://google.github.io/oss-fuzz/getting-started/continuous-integration/ It downloads the corpus OSS-Fuzz has accumulated so far (including the test cases that triggered issues in the past) and runs the fuzz target with it. It should help to catch most regressions when PRs are opened. Prompted by secdev#4373.
using https://google.github.io/oss-fuzz/getting-started/continuous-integration/ It downloads the corpus OSS-Fuzz has accumulated so far (including the test cases that triggered issues in the past) and runs the fuzz target with it. It should help to catch most regressions when PRs are opened. Prompted by secdev#4373.
using https://google.github.io/oss-fuzz/getting-started/continuous-integration/ It downloads the corpus OSS-Fuzz has accumulated so far (including the test cases that triggered issues in the past) and runs the fuzz target with it. It should help to catch most regressions when PRs are opened. Prompted by secdev#4373.
using https://google.github.io/oss-fuzz/getting-started/continuous-integration/ It downloads the corpus OSS-Fuzz has accumulated so far (including the test cases that triggered issues in the past) and runs the fuzz target with it. It should help to catch most regressions when PRs are opened. Prompted by secdev#4373.
using https://google.github.io/oss-fuzz/getting-started/continuous-integration/ It downloads the corpus OSS-Fuzz has accumulated so far (including the test cases that triggered issues in the past) and runs the fuzz target with it. It should help to catch most regressions when PRs are opened. Prompted by secdev#4373.
using https://google.github.io/oss-fuzz/getting-started/continuous-integration/ It downloads the corpus OSS-Fuzz has accumulated so far (including the test cases that triggered issues in the past) and runs the fuzz target with it. It should help to catch most regressions when PRs are opened. Prompted by secdev#4373.
using https://google.github.io/oss-fuzz/getting-started/continuous-integration/ It downloads the corpus OSS-Fuzz has accumulated so far (including the test cases that triggered issues in the past) and runs the fuzz target with it. It should help to catch most regressions when PRs are opened. Prompted by secdev#4373.
* ci: run the fuzz target on PRs using https://google.github.io/oss-fuzz/getting-started/continuous-integration/ It downloads the corpus OSS-Fuzz has accumulated so far (including the test cases that triggered issues in the past) and runs the fuzz target with it. It should help to catch most regressions when PRs are opened. Prompted by #4373. * dcerpc: turn print into log_runtime.warning to make it possible to turn it off with logging.disable(). (it should help to make the fuzz target less chatty among other things because it seems to be the only dissector (covered by the fuzz target) printing messages like that directly)
This PR fixes issues discovered by oss-fuzz.