Skip to content

Comments

next/278/20240206/v1#10321

Merged
victorjulien merged 7 commits intoOISF:masterfrom
victorjulien:next/278/20240206/v1
Feb 6, 2024
Merged

next/278/20240206/v1#10321
victorjulien merged 7 commits intoOISF:masterfrom
victorjulien:next/278/20240206/v1

Conversation

inashivb and others added 7 commits February 6, 2024 10:15
StreamingBuffer is not required to find the intersecting regions, so,
don't pass it as a param to the fn.
Ticket: 5446

That means it can accept ranges
port is not used and logically makes sense to not be in this struct as
this struct is already referenced by DetectPort itself as a part of
SigGroupHead.
Present scenario
----------------
Currently, as a part of setting signature count per SGH, a max_idx is
passed which could be as high as the highest signature number (internal
ID).

Issue
-----
Not every SGH needs to evaluate all the signatures while setting
the signature count or while creating the match_array.
In a nonideal scenario, when say, there are 2 SGHs and one SGH has 2
signatures and the other one has 60k, given the current scheme of
evaluating max_idx, the max_idx will be set to 60k, and this shall
later be passed on to SigGroupHeadSetSigCnt or
SigGroupHeadBuildMatchArra which shall traverse over all the 60k sigs
for either SGHs.

Other info
----------
This is a very fast operation as the internal arithmetic is done
bitwise.

Patch
-----
The functions SigGroupHeadSetSigCnt and SigGroupHeadBuildMatchArray can
be optimized by storing the max signature id (internal) per SGH (which
also seemed to be the initial intention as per fn comments).
As a result of this, the sig_array is only walked up until the max sig
id of that respective SGH.
Errors when a detection engine gets 65k filestore signatures to
avoid the hard limit to have 65k filestore per signature group
head

Ticket: OISF#6393
@codecov
Copy link

codecov bot commented Feb 6, 2024

Codecov Report

Attention: 3 lines in your changes are missing coverage. Please review.

Comparison is base (244a35d) 73.31% compared to head (db99c45) 82.34%.

Additional details and impacted files
@@             Coverage Diff             @@
##           master   #10321       +/-   ##
===========================================
+ Coverage   73.31%   82.34%    +9.02%     
===========================================
  Files         895      978       +83     
  Lines      148215   272003   +123788     
===========================================
+ Hits       108666   223971   +115305     
- Misses      39549    48032     +8483     
Flag Coverage Δ
fuzzcorpus 63.60% <87.87%> (+0.11%) ⬆️
suricata-verify 61.48% <72.72%> (-0.05%) ⬇️
unittests 62.84% <81.08%> (?)

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 18132

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.

5 participants