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/350/20240316/v1 #10652

Merged
merged 26 commits into from
Mar 16, 2024
Merged

Conversation

victorjulien and others added 26 commits March 16, 2024 09:29
This is so patterns can reply on mpm match meaning a full match.

Not yet used.
When a pattern is using endswith, only consider it a match when it
is the end of the data.

Ticket: OISF#6852.
Issue: 6408

Use the Suricata thread id for plugin thread initialization to give the
plugin a better correlating factor to the actual Suricata threads.
Remove EVE filetypes from plugin context as they are not only used
from plugins. Plugins allow user code to register filetypes, but we
also have internal file types that use this api including the null
output and syslog.  Additionally library users can use this API to
register filetypes, and they are not plugins.

Ideally this code would go in "output-json.[ch]" as the "primary" eve
API, however there are currently some include circular include issues
there, so start new cleaned up EVE API in "output-eve.[ch]" which is
"clean" with respect to includes, and as we cleanup existing EVE API for
"public" use, it can be moved here.

Ticket: OISF#6838
Remove "conf.h" from suricata-plugin.h as its not needed by that
header. However, some other files became transitively dependent on
through other includes, so fix those up.
EVE filetypes are not always plugins, for example, null and syslog
that are built-in filetypes.
In 7.0 if EVE was non-threaded, the ThreadInit for the filetype was
not called meaning that the filetype author had to handle the threaded
and non-threaded cases.

To simplify this, if non-threaded, still call ThreadInit (and
ThreadDeinit) once with a thread_id of 0. This should simplify
authoring EVE filetype plugins.
Add documentation for the SCEveFileType in Doxygen format.
Change ThreadDeinit to return void instead of an int, there is nothing
to be done on success or failure.
Add an upgrade section to the devguide. This should cover any changes
to APIs that users might be using from plugins or as a library user.
When Suricata was running in IPS mode and received a signal to stop,
the first worker of every interface/port stopped the port and
proactively stopped the peered interface as well.
This was done to be as accurate with port stats as possible.
However, in a highly active scenarios (lots of packets moving around)
the peered workers might still be in the process of a packet
release operation. These workers would then attempt to transmit
on a stopped interface - resulting in an errorneous operation.

Instead, this patch proposes a worker synchronization of the given
port. After these workers are synchronized, it is known that no packets
will be sent of the peered interface, therefore the first worker can
stop it. This however cannot be assumed about "its own" port as the
peered workers can still try to send the packets. Therefore, ports
are only stopped by the peered workers.

Ticket: OISF#6790
Issue: 6835

When injecting a flow, ensure that the selected thread_id has been
initialized. When a flow is picked up midstream, the initialized thread
can be the second thread element.
Issue: 6835

When swapping the flow's direction, also swap the thread_ids.

This should help with the issues identified in
https://redmine.openinfosecfoundation.org/issues/2725
@victorjulien victorjulien requested review from jasonish, jufajardini and a team as code owners March 16, 2024 11:29
Copy link

codecov bot commented Mar 16, 2024

Codecov Report

Attention: Patch coverage is 60.37736% with 63 lines in your changes are missing coverage. Please review.

Project coverage is 82.69%. Comparing base (ece2029) to head (e41c2f1).

Additional details and impacted files
@@           Coverage Diff           @@
##           master   #10652   +/-   ##
=======================================
  Coverage   82.68%   82.69%           
=======================================
  Files         925      926    +1     
  Lines      247552   247574   +22     
=======================================
+ Hits       204680   204719   +39     
+ Misses      42872    42855   -17     
Flag Coverage Δ
fuzzcorpus 64.04% <40.83%> (+0.08%) ⬆️
suricata-verify 61.87% <46.66%> (-0.01%) ⬇️
unittests 62.20% <54.08%> (-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 19537

Copy link
Contributor

@jlucovsky jlucovsky left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

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