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

Discard truncate fn/v2 #11411

Closed
wants to merge 2 commits into from
Closed

Conversation

inashivb
Copy link
Member

@inashivb inashivb commented Jul 3, 2024

Link to ticket: https://redmine.openinfosecfoundation.org/issues/7044

SV_BRANCH=OISF/suricata-verify#1953

Previous PR: #11393

Changes since v1:

  • added explanation in the commit message
  • removed all truncate glue code and parser calls

TODO: smb glue code is removed but the truncate fn still exists as it is used at several places. Nothing was affected on tests locally but would like to see if it has an impact in the bigger QA.

truncate fn is only active and used by dcerpc and smb parsers. In case
stream depth is reached for any side, truncate fn is supposed to set the
tx entity (request/response) in the same direction as complete so the
other side is not forever waiting for data.

However, whether the stream depth is reached is already checked by
AppLayerParserGetStateProgress fn which is called by:
- DetectTx
- DetectEngineInspectBufferGeneric
- AppLayerParserSetTransactionInspectId
- OutputTxLog
- AppLayerParserTransactionsCleanup

and, in such a case, StateGetProgressCompletionStatus is returned for
the respective direction. This fn following efc9a7a, always returns 1
as long as the direction is valid meaning that the progress for the
current direction is marked complete. So, there is no need for the additional
callback to mark the entities as done in case of depth or a gap.
Remove all such glue code and callbacks for truncate fns.

Bug 7044
Copy link

codecov bot commented Jul 3, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 82.42%. Comparing base (653e702) to head (d62cab3).

Additional details and impacted files
@@            Coverage Diff             @@
##           master   #11411      +/-   ##
==========================================
- Coverage   82.45%   82.42%   -0.04%     
==========================================
  Files         938      938              
  Lines      248036   247976      -60     
==========================================
- Hits       204523   204397     -126     
- Misses      43513    43579      +66     
Flag Coverage Δ
fuzzcorpus 60.09% <83.33%> (-0.02%) ⬇️
livemode 18.71% <0.00%> (-0.02%) ⬇️
pcap 43.73% <100.00%> (-0.04%) ⬇️
suricata-verify 61.34% <100.00%> (-0.07%) ⬇️
unittests 59.44% <33.33%> (-0.01%) ⬇️

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

@suricata-qa
Copy link

Information: QA ran without warnings.

Pipeline 21357

@catenacyber
Copy link
Contributor

Commit removing Truncate looks good to me (besides need to remove rs_smb_state_truncate in addition)

Other commit looks suspicious... I guess it is ok but it needs more explanations...

@inashivb inashivb mentioned this pull request Jul 5, 2024
@inashivb inashivb closed this Jul 5, 2024
@inashivb inashivb deleted the discard-truncate-fn/v2 branch July 5, 2024 10:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

4 participants