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

next/217/20231207/v1 #9999

Merged
merged 21 commits into from
Dec 7, 2023
Merged

Conversation

victorjulien
Copy link
Member

ilya-bakhtin and others added 21 commits December 7, 2023 09:56
This commit takes care of original seconds value and prevents the
useconds field from overflowing pas its maximum value.

Issue: 6372
Initialize both seconds and useconds of packet timestamp from napatech
timestamp format.

This commit uses updated macro definitions from util-utime.h to avoid
zero seconds value.

Issue: 6372
Fix SCTIME_ADD_SECS zeroing subsecond part

When adding s seconds to SCtime_t ts, don't zero out the ts.usecs field.

Issue: 6584

Fix SCTIME_FROM_TIMESPEC garbage microseconds part

When converting nanosecond to microseconds divide by 1000 instead
of multiplying by 1000.

Issue: 6585
Hitting the recursion limit should be rare.
This is a convinience addition to abstract away the internals of
the InspectionBuffer in keyword specific detection code.
Integrate with rest of content inspect code.
Use stack local var instead of DetectEngineThreadCtx member. Instead
setup a stack local struct that both counts and holds the limit. Make sure
the limit is a const so we can avoid rereading it.

This is part of an effort to reduce the size of the DetectEngineThreadCtx
structure and reduce the number of memory writes to it. Additionally, it
is part of an effect to reduce the number of places where detection
tracks various forms of state.
Flatten else branches after terminating ifs.
Since recursive content matching goes through the buffer from left to
right, it is possible to bail early when isdataat is part of the
recursive checking. If `isdataat:50,relative` fails for offset 10, it
will surely also fail for offset 20. So break inspection in such cases.

The exception is for dynamic isdataat, where the value is determined
by a prior byte_extract that may be updated during the recursion.
DetectEngineThreadCtx::replist is managed elsewhere.
Adjust includes to enable this.
Move reference count to top of DetectEngineThreadCtx, to move it to the
same cache line as the other members that are checked first in Detect().
Move members used by DetectEngineContentInspection() to the same cache line.
Copy link

codecov bot commented Dec 7, 2023

Codecov Report

Merging #9999 (332c2ea) into master (bdec2d8) will decrease coverage by 0.02%.
The diff coverage is 93.28%.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #9999      +/-   ##
==========================================
- Coverage   82.47%   82.46%   -0.02%     
==========================================
  Files         970      970              
  Lines      271355   271372      +17     
==========================================
- Hits       223798   223776      -22     
- Misses      47557    47596      +39     
Flag Coverage Δ
fuzzcorpus 64.56% <75.21%> (-0.02%) ⬇️
suricata-verify 61.30% <82.90%> (-0.04%) ⬇️
unittests 62.88% <79.86%> (+<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 16919

@victorjulien victorjulien merged commit 332c2ea into OISF:master Dec 7, 2023
45 checks passed
@victorjulien victorjulien deleted the next/217/20231207/v1 branch December 7, 2023 19:38
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