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

tx: fix unidirection transaction cleanup (dns tx fix) - v4 #6076

Merged
merged 2 commits into from Apr 23, 2021

Conversation

jasonish
Copy link
Member

Fir commit fixes unidirection transaction handling. We only want to mark a TX as skipped if skipped in both the TS and TC side if unidirectional. If one side is seen, then its complete. Instead it has been marked as skipped, so the starting TX ID on cleanup is never incremented, resulting in a larger number of iterations as the transaction grow on a session.

This was easily seen with DNS when multiple transactions occurred on the same flow before the flow timed out. In many cases this would not be noticed, but is really notiecable when there are devices present that blast DNS requests over the same session.

Note: You must have some rules enabled to hit this case, it doesn't appear to show up if you have no rules enabled.

The second commit just removes the DNS flood protection which appears is not needed, as it only kicks in when it should not kick in.

Redmine issue:
https://redmine.openinfosecfoundation.org/issues/4437

A unidirection protocol parser should only have its transactions
marked as "skipped" if it is skipped in both the TS and TC
directions, otherwise unidir transactions are always considered
skipped and the cleanup will never updates its minimum id.

Redmine issue:
https://redmine.openinfosecfoundation.org/issues/4437
It doesn't look like flood protection is required with the
stateless parser anymore. It actually can get in the way of TCP
DNS when a large number of requests end-up in the same segment
where a TX can get purged before it has a chance to go through
the normal TX life-cycle.
@jasonish jasonish requested review from victorjulien and a team as code owners April 22, 2021 16:09
@codecov
Copy link

codecov bot commented Apr 22, 2021

Codecov Report

Merging #6076 (c7f4444) into master (fc7a443) will decrease coverage by 0.00%.
The diff coverage is 100.00%.

@@            Coverage Diff             @@
##           master    #6076      +/-   ##
==========================================
- Coverage   77.02%   77.02%   -0.01%     
==========================================
  Files         612      612              
  Lines      187682   187684       +2     
==========================================
- Hits       144558   144555       -3     
- Misses      43124    43129       +5     
Flag Coverage Δ
fuzzcorpus 53.02% <0.00%> (-0.01%) ⬇️
suricata-verify 50.26% <100.00%> (-0.02%) ⬇️
unittests 63.26% <0.00%> (-0.01%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

@victorjulien victorjulien mentioned this pull request Apr 23, 2021
@victorjulien victorjulien merged commit c7f4444 into OISF:master Apr 23, 2021
@victorjulien
Copy link
Member

Thanks!

@jasonish jasonish deleted the dns-tx-fixup/v4 branch July 1, 2021 17:11
catenacyber added a commit to catenacyber/suricata that referenced this pull request May 26, 2023
jasonish pushed a commit to jasonish/suricata that referenced this pull request May 26, 2023
jasonish pushed a commit to jasonish/suricata that referenced this pull request May 26, 2023
jasonish added a commit to jasonish/suricata that referenced this pull request May 26, 2023
jasonish pushed a commit to jasonish/suricata that referenced this pull request Jun 5, 2023
jasonish added a commit to jasonish/suricata that referenced this pull request Jun 5, 2023
jasonish added a commit to jasonish/suricata that referenced this pull request Jun 5, 2023
jasonish pushed a commit to jasonish/suricata that referenced this pull request Jun 19, 2023
jasonish added a commit to jasonish/suricata that referenced this pull request Jun 19, 2023
catenacyber added a commit to catenacyber/suricata that referenced this pull request Jun 28, 2023
catenacyber added a commit to catenacyber/suricata that referenced this pull request Jun 28, 2023
catenacyber added a commit to catenacyber/suricata that referenced this pull request Jun 29, 2023
jasonish pushed a commit to jasonish/suricata that referenced this pull request Jul 6, 2023
victorjulien pushed a commit to victorjulien/suricata that referenced this pull request Nov 16, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
2 participants