]> git.ipfire.org Git - thirdparty/suricata.git/log
thirdparty/suricata.git
24 hours agodetect/engine: simplify stats counters registration master 13693/head
Juliana Fajardini [Mon, 28 Jul 2025 22:55:39 +0000 (19:55 -0300)] 
detect/engine: simplify stats counters registration

24 hours agodetect: remove unused non-pf stats counters
Juliana Fajardini [Fri, 25 Jul 2025 21:42:32 +0000 (18:42 -0300)] 
detect: remove unused non-pf stats counters

Remove unused rule prefilter-related stats counters that aren't in use.

94644ac9604c (detect: move non-pf rules into special prefilter engines)
removed the logic that made use of and incremented the stats counters:
- det_ctx->counter_fnonmpm_list
- det_ctx->counter_nonmpm_list

Some code was left, registering them, and mentioning them in the
json schema.

Ticket #7834

24 hours agogithub-actions: bump github/codeql-action from 3.29.2 to 3.29.5
dependabot[bot] [Fri, 1 Aug 2025 19:27:01 +0000 (19:27 +0000)] 
github-actions: bump github/codeql-action from 3.29.2 to 3.29.5

Bumps [github/codeql-action](https://github.com/github/codeql-action) from 3.29.2 to 3.29.5.
- [Release notes](https://github.com/github/codeql-action/releases)
- [Commits](https://github.com/github/codeql-action/compare/v3.29.2...v3.29.5)

---
updated-dependencies:
- dependency-name: github/codeql-action
  dependency-version: 3.29.5
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
24 hours agofile: remove unused flag
Philippe Antoine [Wed, 9 Jul 2025 10:00:20 +0000 (12:00 +0200)] 
file: remove unused flag

FLOWFILE_NO_SIZE_* are unused, whose removal shows that
SIG_GROUP_HEAD_HAVEFILESIZE gets unused, whose removal shows that
SignatureIsFilesizeInspecting gets unused

24 hours agodoc/dpdK: update RX/TX descriptor note for Connect-X 4
Lukas Sismis [Tue, 29 Jul 2025 08:52:36 +0000 (10:52 +0200)] 
doc/dpdK: update RX/TX descriptor note for Connect-X 4

Ticket: 7639

24 hours agoapp-layer: fix ippair memcap counters
Adam Kiripolsky [Tue, 22 Jul 2025 12:40:34 +0000 (14:40 +0200)] 
app-layer: fix ippair memcap counters

Fixed counter for ippair.memcap by using the correct function,
IPPairGetMemcap.
Until now IPPairGetMemuse was used both for memuse and memcap.

Ticket: 7827

4 days agolua: document the dnp3 lib 13683/head
Jason Ish [Wed, 30 Jul 2025 23:36:33 +0000 (17:36 -0600)] 
lua: document the dnp3 lib

Ticket: #7631

4 days agodoc/upgrade: mention that lua rules are enabled by default
Jason Ish [Wed, 30 Jul 2025 18:01:20 +0000 (12:01 -0600)] 
doc/upgrade: mention that lua rules are enabled by default

4 days agodoc/lua-detection: fix example script; remove most buffers
Jason Ish [Mon, 28 Jul 2025 22:23:41 +0000 (16:23 -0600)] 
doc/lua-detection: fix example script; remove most buffers

- Reference rule hooks instead

Ticket: #7728

4 days agodoc/lua-output: fix example script for new apis
Jason Ish [Mon, 28 Jul 2025 21:59:01 +0000 (15:59 -0600)] 
doc/lua-output: fix example script for new apis

Ticket: #7728

4 days agodoc/lua-functions: update lua-function documentation
Jason Ish [Mon, 28 Jul 2025 21:50:34 +0000 (15:50 -0600)] 
doc/lua-functions: update lua-function documentation

- cleanup usage and documentation around needs
- mentiond that rule hooks are used instead of "needs" keywords with
  link with rule hooks (which is still in the firewall-design doc)

4 days agodoc/install: remove reference to --enable-lua
Jason Ish [Mon, 28 Jul 2025 20:15:11 +0000 (14:15 -0600)] 
doc/install: remove reference to --enable-lua

This configure command no longer exists.

4 days agodoc/lua-detection: update note to mention rules are enabled by default
Jason Ish [Mon, 28 Jul 2025 20:11:53 +0000 (14:11 -0600)] 
doc/lua-detection: update note to mention rules are enabled by default

In 8.0, Lua rules are enabled by default.

4 days agogithub-ci: finish removing cppclean
Jason Ish [Wed, 30 Jul 2025 16:05:26 +0000 (10:05 -0600)] 
github-ci: finish removing cppclean

Completes commit 2d308c000d58dbf5323599fc7f1694e14f1f375b.

4 days agogithub-ci: add almalinux 10 build
Jason Ish [Tue, 29 Jul 2025 14:28:21 +0000 (08:28 -0600)] 
github-ci: add almalinux 10 build

Based on the current AlmaLinux 9 build, with plugin tests, etc.
Remove cppclean as its not installed and was previously disabled with
commit 2d308c000d58dbf5323599fc7f1694e14f1f375b.

4 days agohyperscan: prevent LTO opmitizing out hash calculation
Lukas Sismis [Tue, 22 Jul 2025 07:57:38 +0000 (09:57 +0200)] 
hyperscan: prevent LTO opmitizing out hash calculation

Since cached_hash was updated through reference (hash), it seems
LTO did not notice this and optimized the whole code block, returning
zero.
This in turn caused all caches to have the same name and to overwrite.
On subsequent runs, only the last cache was loaded for all SGHs
causing wrong MPM assignment.

Ticket: 7824

4 days agogithub-ci: add flto build
Jason Ish [Tue, 22 Jul 2025 14:29:08 +0000 (08:29 -0600)] 
github-ci: add flto build

Ubuntu and Fedora packing system build with -flto=auto by default, so
update one test to use -flto=auto. Also build with -O2 as that
combination can cause issues such as
https://redmine.openinfosecfoundation.org/issues/7824.

Also adds vectorscan to the build.

4 days agolua/bytevarlib: return luaL_error to suppress warning
Jason Ish [Mon, 21 Jul 2025 20:50:20 +0000 (14:50 -0600)] 
lua/bytevarlib: return luaL_error to suppress warning

Even though luaL_error never returns, use a return to make it
clear. Also prevents a compiler warning about idx being used
uninitialized.

4 days agodetect-engine-address: initialize pointer in unit tests
Jason Ish [Mon, 21 Jul 2025 21:01:25 +0000 (15:01 -0600)] 
detect-engine-address: initialize pointer in unit tests

To prevent the compiler warning about "c" being used uninitialized
with LTO.

4 days agoutil-byte: fix usage of util-byte integer parsers
Jason Ish [Mon, 21 Jul 2025 20:48:14 +0000 (14:48 -0600)] 
util-byte: fix usage of util-byte integer parsers

Functions like ByteExtractStringUint8 return 0 or less on
failure. Many usages of this function treat 0 as successful as its our
common pattern.

Ticket: #7836

4 days agodoc/lua: fix typo in stream toserver and toclient
Alexandre Iooss [Mon, 14 Jul 2025 06:53:32 +0000 (08:53 +0200)] 
doc/lua: fix typo in stream toserver and toclient

4 days agohttp2: do not log empty objects for request or response
Philippe Antoine [Tue, 15 Jul 2025 12:58:49 +0000 (14:58 +0200)] 
http2: do not log empty objects for request or response

Ticket: 7741

4 days agooutput: fix NULL deref if no app-layer is logged
Philippe Antoine [Fri, 18 Jul 2025 12:46:56 +0000 (14:46 +0200)] 
output: fix NULL deref if no app-layer is logged

Ticket: 7815

4 days agooutput: fix condition for community id with same ip
Philippe Antoine [Fri, 18 Jul 2025 14:11:59 +0000 (16:11 +0200)] 
output: fix condition for community id with same ip

Ticket: 5689

4 days agocounters: hard fail on allocation failure during init
Philippe Antoine [Tue, 22 Jul 2025 08:04:13 +0000 (10:04 +0200)] 
counters: hard fail on allocation failure during init

Ticket: 7813

4 days agoconf/output: friendly error message on bad configuration
Philippe Antoine [Fri, 18 Jul 2025 13:51:37 +0000 (15:51 +0200)] 
conf/output: friendly error message on bad configuration

Ticket: 7611

Instead of segfault

output.types expects a sequence of one-key mappings, instead
of directly a mapping

4 days agodoc/suricatasc: Mentioned get-flow-stats-by-id cmd
Jeff Lucovsky [Sun, 27 Jul 2025 14:02:05 +0000 (10:02 -0400)] 
doc/suricatasc: Mentioned get-flow-stats-by-id cmd

Add get-flow-stats-by-id to the list of commands supported by suricatasc

Issue: 7081

4 days agobuild: include first rust/gen
Philippe Antoine [Tue, 22 Jul 2025 08:20:32 +0000 (10:20 +0200)] 
build: include first rust/gen

Ticket: 7804

Allows especially to prefer our lua (rust crate) includes over
the system one

4 days agodoh: do not log dns events when there is no DNS
Philippe Antoine [Wed, 9 Jul 2025 13:34:44 +0000 (15:34 +0200)] 
doh: do not log dns events when there is no DNS

Ticket: 7740

When we have a pure HTTP2 transaction (such as settings), we want
to log a http event

4 days agosnmp: fix the possibility to disable the parser
Philippe Antoine [Fri, 18 Jul 2025 13:16:09 +0000 (15:16 +0200)] 
snmp: fix the possibility to disable the parser

Ticket: 7820

Do not register anything, not even ALPROTO_SNMP "snmp" string
if parser is disabled

12 days agoci: use debian 12 for xdp 13646/head
Philippe Antoine [Wed, 23 Jul 2025 08:37:41 +0000 (10:37 +0200)] 
ci: use debian 12 for xdp

As bullseye is EOL so it is being removed from the mirrors

https://lists.debian.org/debian-backports/2024/07/msg00003.html

[Edit by JI: Add xdp to distcheck build as well.]

3 weeks agogithub-ci: remove debian:10 build, it is EOL 13595/head 13597/head
Jason Ish [Mon, 14 Jul 2025 14:43:37 +0000 (08:43 -0600)] 
github-ci: remove debian:10 build, it is EOL

3 weeks agodoc/reload: Expand rule-reload discussion 13589/head
Jeff Lucovsky [Sun, 22 Jun 2025 19:39:13 +0000 (19:39 +0000)] 
doc/reload: Expand rule-reload discussion

Clarify the resources involved in a rule reload.

Issue: 5078

3 weeks agodoc: add some missing url and desc
Eric Leblond [Wed, 9 Jul 2025 06:08:40 +0000 (08:08 +0200)] 
doc: add some missing url and desc

Keywords registration should provide a desc and a link to the
documentation. This patch adds desc and/or url for on most keywords
missing that.

This allows better output for list-keywords command line which
is then use in Suricata Language Server.

3 weeks agogen/typo: Misc. typo fixes
Jeff Lucovsky [Mon, 30 Jun 2025 13:39:34 +0000 (09:39 -0400)] 
gen/typo: Misc. typo fixes

3 weeks agodoc/netflow: Discuss netflow
Jeff Lucovsky [Sat, 28 Jun 2025 14:18:49 +0000 (10:18 -0400)] 
doc/netflow: Discuss netflow

Add discussion for netflow configuration, event type and fields
contained in netflow records.

Issue: 5139

4 weeks agoversion: start development towards 8.0.1 13578/head 13587/head
Shivani Bhardwaj [Wed, 9 Jul 2025 05:58:04 +0000 (11:28 +0530)] 
version: start development towards 8.0.1

4 weeks agorelease: 8.0.0; update changelog 13573/head suricata-8.0.0
Shivani Bhardwaj [Tue, 8 Jul 2025 00:37:47 +0000 (06:07 +0530)] 
release: 8.0.0; update changelog

4 weeks agohttp2: do not set file flags for global txs
Philippe Antoine [Tue, 15 Apr 2025 10:38:34 +0000 (12:38 +0200)] 
http2: do not set file flags for global txs

Global txs means here txs with stream id 0, used for connection control
messages.

4 weeks agohttp2: mark old txs as updated
Philippe Antoine [Tue, 15 Apr 2025 10:36:47 +0000 (12:36 +0200)] 
http2: mark old txs as updated

As is done in the other case a few lines below

4 weeks agohttp2: forbid data on stream 0
Philippe Antoine [Tue, 15 Apr 2025 10:34:37 +0000 (12:34 +0200)] 
http2: forbid data on stream 0

Ticket: 7658

Suricata will not handle well if we open a file for this tx,
do not close it, but set the transaction state to completed.

RFC 9113 section 6.1 states:

If a DATA frame is received whose Stream Identifier field is 0x00,
the recipient MUST respond with a connection error (Section 5.4.1)
 of type PROTOCOL_ERROR.

4 weeks agolib: opt-in signal handlers 13568/head
Jason Ish [Mon, 30 Jun 2025 21:55:21 +0000 (15:55 -0600)] 
lib: opt-in signal handlers

Instead of enabling signal handlers by default, require the user of
the library to opt-in. This is done with the call to
SCEnableDefaultSignalHandlers, which sets a flag to add the default
signal handlers.

This seems like the least invasive way to do this at this time, but it
will require some re-thinking for 9.0, especially if migrate globals
to engine instances, signal handling will need to be re-thought.

Ticket: #6814

4 weeks agogithub-actions: bump github/codeql-action from 3.28.18 to 3.29.2
dependabot[bot] [Tue, 1 Jul 2025 19:07:53 +0000 (19:07 +0000)] 
github-actions: bump github/codeql-action from 3.28.18 to 3.29.2

Bumps [github/codeql-action](https://github.com/github/codeql-action) from 3.28.18 to 3.29.2.
- [Release notes](https://github.com/github/codeql-action/releases)
- [Commits](https://github.com/github/codeql-action/compare/v3.28.18...v3.29.2)

---
updated-dependencies:
- dependency-name: github/codeql-action
  dependency-version: 3.29.2
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
5 weeks agodpdk: auto threads assign one too many threads 13565/head
Lukas Sismis [Tue, 1 Jul 2025 19:43:19 +0000 (21:43 +0200)] 
dpdk: auto threads assign one too many threads

Configuration option `threads: auto` in DPDK's interface node
overassigns available threads to the interface.
Commit 4dfd44d3 changed the signedness of the remaining threads counter,
which caused surpass of the counter initialization.
The if-clause is switched to first initialize and then use the counter.

Ticket: 7798

5 weeks agorust/Makefile: sort filenames
Jason Ish [Mon, 30 Jun 2025 17:31:57 +0000 (11:31 -0600)] 
rust/Makefile: sort filenames

Misc cleanup as these lists are growing.

5 weeks agorust/htp: follow suricata versioning
Jason Ish [Mon, 30 Jun 2025 14:56:55 +0000 (08:56 -0600)] 
rust/htp: follow suricata versioning

Have htp follow Suricata versioning so we don't have to worry about
version updates as it changes.

For example, between 8.0.0-beta1 and 8.0.0-rc1 there were changes to
the htp, however the version stayed at 2.0.0 making it impossible to
publish these changes to crates.io.

5 weeks agodetect-bytetest: remove meaningless NULL check on data_offset
Boris Tonofa [Mon, 30 Jun 2025 13:39:47 +0000 (16:39 +0300)] 
detect-bytetest: remove meaningless NULL check on data_offset

The condition data_offset == NULL can never be true: data_offset has
already been validated as non-NULL a few lines earlier. The guard seems
to have been intended for the offset argument, yet throughout the
codebase offset is never passed as NULL. (In the unit tests, offset is
NULL, but those tests pass the value parameter as NULL, which causes the
function to return before offset is dereferenced.)

Remove the pointless check to simplify control flow and silence
static-analysis warnings.

No functional change.

Bug 7767

5 weeks agohttp: do not yield after failed connect if already pipelined 13557/head
Philippe Antoine [Thu, 26 Jun 2025 09:03:11 +0000 (11:03 +0200)] 
http: do not yield after failed connect if already pipelined

Ticket: 7791

5 weeks agodoc: add upgrade note about change in inspection
Shivani Bhardwaj [Fri, 20 Jun 2025 11:00:44 +0000 (16:30 +0530)] 
doc: add upgrade note about change in inspection

5 weeks agosmtp: trigger raw stream inspection
Shivani Bhardwaj [Mon, 30 Jun 2025 10:24:35 +0000 (15:54 +0530)] 
smtp: trigger raw stream inspection

Internals
---------
Suricata's stream engine returns data for inspection to the detection
engine from the stream when the chunk size is reached.

Bug
---
Inspection triggered only in the specified chunk sizes may be too late
when it comes to inspection of smaller protocol specific data which
could result in delayed inspection, incorrect data logged with a transaction
and logs misindicating the pkt that triggered an alert.

Fix
---
Fix this by making an explicit call from all respective applayer parsers to
trigger raw stream inspection which shall make the data available for inspection
in the following call of the stream engine. This needs to happen per direction
on the completion of an entity like a request or a response.

Important notes
---------------
1. The above mentioned behavior with and without this patch is
affected internally by the following conditions.
- inspection depth
- stream depth
In these special cases, the inspection window will be affected and
Suricata may not consider all the data that could be expected to be
inspected.
2. This only applies to applayer protocols running over TCP.
3. The inspection window is only considered up to the ACK'd data.
4. This entire issue is about IDS mode only.

SMTP parser can handle multiple command lines per direction. Appropriate calls
to trigger raw stream inspection have been added on succesful parsing of each
request line and response line.

For the requests, the call to trigger inspection has been added in the
beginning rather than the completion of transactions. This does not
affect the inspection as it is actually triggered in the following call.
This covers the case for anomaly as well. There are two benefits for
this:
- immediate inspection for anomalous data
- flushing of the anomalous data making next data's inspection cleaner

Bug 7783

5 weeks agosmtp: revert ab01a1b
Shivani Bhardwaj [Mon, 30 Jun 2025 08:58:56 +0000 (14:28 +0530)] 
smtp: revert ab01a1b

to build the correct behavior. As a part of ab01a1b, in order to match
the behavior in master, the calls for triggering raw stream inspection
were made when communication in one direction for a transaction was
completed. However, it was incorrect to do so. Reliable inspection
requires any request line/response line to be completed.

Bug 7783

5 weeks agosrc: remove BUG_ON in packet path
Philippe Antoine [Thu, 26 Jun 2025 09:36:36 +0000 (11:36 +0200)] 
src: remove BUG_ON in packet path

Transforms them into debug validations

Ticket: 1484

Packet path is here considered FlowWorker and all lines
covered by SV tests are here fixed

5 weeks agosrc: remove direct calls to abort
Philippe Antoine [Thu, 26 Jun 2025 09:16:36 +0000 (11:16 +0200)] 
src: remove direct calls to abort

use BUG_ON macros instead

Ticket: 1484

5 weeks agoci: test with latest rust stable version 1.88 13545/head
Philippe Antoine [Fri, 27 Jun 2025 07:21:50 +0000 (09:21 +0200)] 
ci: test with latest rust stable version 1.88

5 weeks agorust: allow collapsible_else_if for debug logs
Philippe Antoine [Fri, 27 Jun 2025 07:20:56 +0000 (09:20 +0200)] 
rust: allow collapsible_else_if for debug logs

see https://github.com/rust-lang/rust-clippy/issues/15158

5 weeks agorust/htp: fix clippy uninlined_format_args
Philippe Antoine [Fri, 27 Jun 2025 07:02:10 +0000 (09:02 +0200)] 
rust/htp: fix clippy uninlined_format_args

   --> htp/src/decompressors.rs:703:64
    |
703 |                 std::io::Error::new(std::io::ErrorKind::Other, format!("{}", e))
    |                                                                ^^^^^^^^^^^^^^^^
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#uninlined_format_args

5 weeks agoconfigure: remove unused strtoul check
Fupeng Zhao [Thu, 19 Jun 2025 06:17:59 +0000 (14:17 +0800)] 
configure: remove unused strtoul check

strtoul is no longer used in the codebase, so the check was removed from AC_CHECK_FUNCS.

5 weeks agodetect/byte: update comments to reflect current parsing logic
Fupeng Zhao [Thu, 19 Jun 2025 06:14:30 +0000 (14:14 +0800)] 
detect/byte: update comments to reflect current parsing logic

5 weeks agoutil/coredump: refactor parsing and respect zero core dump limit
Fupeng Zhao [Thu, 19 Jun 2025 06:03:50 +0000 (14:03 +0800)] 
util/coredump: refactor parsing and respect zero core dump limit

- Replaced strtoul/strtoull with ByteExtractString* for safer and more consistent parsing.
- Allowed max-dump to be set to 0, and correctly apply a core dump limit of 0, maintaining behavior consistent with the commented default in suricata.yaml.in.
- Added and registered unit tests to validate the updated logic.

Ticket: #7212

5 weeks agodetect: replace strtoul with ByteExtractStringUint32
Fupeng Zhao [Thu, 19 Jun 2025 05:48:07 +0000 (13:48 +0800)] 
detect: replace strtoul with ByteExtractStringUint32

Also added and updated unit tests to ensure correctness.

Ticket: #7212

5 weeks agomisc/debug: Use SCConfDump 13541/head
Jeff Lucovsky [Thu, 26 Jun 2025 14:17:45 +0000 (10:17 -0400)] 
misc/debug: Use SCConfDump

The API entrypoint for ConfDump has changed so update the #ifdef'd
code to use it.

5 weeks agodpdk: complete function prototype definition
Lukas Sismis [Wed, 25 Jun 2025 09:40:20 +0000 (11:40 +0200)] 
dpdk: complete function prototype definition

Ticket: 7789

5 weeks agoaffinity: initialize CPU sets with online CPUs only
Lukas Sismis [Wed, 25 Jun 2025 09:18:56 +0000 (11:18 +0200)] 
affinity: initialize CPU sets with online CPUs only

When no CPU set is explicitly defined, switch from
UtilCpuGetNumProcessorsConfigured() (which counts all existing CPU
cores, even offline ones) to UtilCpuGetNumProcessorsOnline() (only
the available cores).
If Suricata initializes more threads than online CPUs it oversubscribes
the system. As Suricata does not support any runtime live reconfiguration
Suricata initializes only as many cores as online CPU cores.

Ticket: 7790

5 weeks agodetect/analyzer: Include ICMP icode information
Jeff Lucovsky [Sun, 15 Jun 2025 14:12:46 +0000 (10:12 -0400)] 
detect/analyzer: Include ICMP icode information

Issue: 6359

Extend the rules analysis to include ICMP icode information.

5 weeks agodetect/analyzer: Support u8 types
Jeff Lucovsky [Sun, 15 Jun 2025 14:12:08 +0000 (10:12 -0400)] 
detect/analyzer: Support u8 types

Issue: 6359

Support JSON output of u8 types

5 weeks agodoc/devguide: document app-layer protocol detection
Philippe Antoine [Tue, 17 Jun 2025 12:53:31 +0000 (14:53 +0200)] 
doc/devguide: document app-layer protocol detection

Ticket: 6022

5 weeks agodoc: document krb5 event type
Philippe Antoine [Tue, 17 Jun 2025 12:01:42 +0000 (14:01 +0200)] 
doc: document krb5 event type

Ticket: 6566

5 weeks agodoc: do not have bittorrent in the middle of SMB events
Philippe Antoine [Tue, 17 Jun 2025 11:42:39 +0000 (13:42 +0200)] 
doc: do not have bittorrent in the middle of SMB events

5 weeks agoschema: document kerberos fields
Philippe Antoine [Tue, 17 Jun 2025 11:42:22 +0000 (13:42 +0200)] 
schema: document kerberos fields

Ticket: 6566

5 weeks agoci: do not run workflows for etc/schema.json
Philippe Antoine [Tue, 17 Jun 2025 19:05:19 +0000 (21:05 +0200)] 
ci: do not run workflows for etc/schema.json

As it is rather a documentation file than code

6 weeks agonfq: suppress coverity thread warning 13519/head
Victor Julien [Sat, 21 Jun 2025 19:13:35 +0000 (21:13 +0200)] 
nfq: suppress coverity thread warning

CID 1593187: (#1 of 1): Data race condition (MISSING_LOCK)
2. missing_lock: Accessing (*p).nfq_v.mark without holding lock Packet_.persistent.tunnel_lock. Elsewhere, NFQPacketVars_.mark is written to with Packet_.persistent.tunnel_lock held 2 out of 5 times (2 of these accesses strongly imply that it is necessary).

No concurrency happening on non-tunnel packet, so no locking needed.

6 weeks agoutil/var-store: suppress coverity warnings
Victor Julien [Sat, 21 Jun 2025 18:59:01 +0000 (20:59 +0200)] 
util/var-store: suppress coverity warnings

6 weeks agodetect/multi-tenant: address various thread safety warnings
Victor Julien [Sat, 21 Jun 2025 18:54:16 +0000 (20:54 +0200)] 
detect/multi-tenant: address various thread safety warnings

6 weeks agopacketpool: improve thread safety 13518/head
Victor Julien [Sat, 21 Jun 2025 14:10:47 +0000 (16:10 +0200)] 
packetpool: improve thread safety

 lock_acquire: Calling pthread_mutex_lock acquires lock PktPoolLockedStack_.mutex.
 87        SCMutexLock(&my_pool->return_stack.mutex);

CID 1554228: (#1 of 1): Indefinite wait (BAD_CHECK_OF_WAIT_COND)
dead_wait: A wait is performed without ensuring that the condition is not already satisfied while holding lock PktPoolLockedStack_.mutex. This can cause a deadlock if the notification happens before the lock is acquired.
      Acquire the lock, then check the wait condition in a loop, without releasing with the lock before the wait. This will prevent deadlocks and failed conditions from spurious wakeups.

6 weeks agodetect/loader: add threading coverity warning
Victor Julien [Sat, 21 Jun 2025 10:42:17 +0000 (12:42 +0200)] 
detect/loader: add threading coverity warning

 lock_acquire: Calling pthread_mutex_lock acquires lock ThreadVars_.ctrl_mutex.
725        SCCtrlMutexLock(th_v->ctrl_mutex);

CID 1554214: (#1 of 1): Indefinite wait (BAD_CHECK_OF_WAIT_COND)
dead_wait: A wait is performed without ensuring that the condition is not already satisfied while holding lock ThreadVars_.ctrl_mutex. This can cause a deadlock if the notification happens before the lock is acquired.
      Acquire the lock, then check the wait condition in a loop, without releasing with the lock before the wait. This will prevent deadlocks and failed conditions from spurious wakeups.

6 weeks agoflow/manager: fix threading/locking coverity warnings
Victor Julien [Thu, 19 Jun 2025 12:24:18 +0000 (14:24 +0200)] 
flow/manager: fix threading/locking coverity warnings

In flow manager and recycler timed condition wait loops.

First check loop break conditions before entiring the timed wait.

CID 1638284: (#1 of 1): Indefinite wait (BAD_CHECK_OF_WAIT_COND)
dead_wait: A wait is performed without ensuring that the condition is not already satisfied while holding lock flow_manager_ctrl_mutex. This can cause a deadlock if the notification happens before the lock is acquired.

CID 1638293: (#1 of 1): Indefinite wait (BAD_CHECK_OF_WAIT_COND)
dead_wait: A wait is performed without ensuring that the condition is not already satisfied while holding lock flow_recycler_ctrl_mutex. This can cause a deadlock if the notification happens before the lock is acquired.

6 weeks agodefrag: improve thread safety in config logging
Victor Julien [Thu, 19 Jun 2025 10:52:32 +0000 (12:52 +0200)] 
defrag: improve thread safety in config logging

CID 1554235: (#1 of 1): Data race condition (MISSING_LOCK)
missing_lock: Accessing defragtracker_spare_q.len without holding lock DefragTrackerStack_.m. Elsewhere, DefragTrackerStack_.len is written to with DefragTrackerStack_.m held 2 out of 2 times.

6 weeks agodatasets: use locking wrappers everywhere
Victor Julien [Thu, 19 Jun 2025 10:33:16 +0000 (12:33 +0200)] 
datasets: use locking wrappers everywhere

To assist coverity, which got confused:

CID 1649393: (#1 of 1): Data race condition (MISSING_LOCK)
missing_lock: Accessing sets without holding lock sets_lock. Elsewhere, sets is written to with sets_lock held 2 out of 3 times.

6 weeks agoeve/schema: map mdns properties that have keywords
Jason Ish [Fri, 20 Jun 2025 18:07:11 +0000 (12:07 -0600)] 
eve/schema: map mdns properties that have keywords

Also add descriptions for the EVE index.

6 weeks agorules: add mdns rules
Jason Ish [Fri, 20 Jun 2025 18:17:12 +0000 (12:17 -0600)] 
rules: add mdns rules

6 weeks ago.gitignore: don't ignore rule files in rules/
Jason Ish [Fri, 20 Jun 2025 18:16:36 +0000 (12:16 -0600)] 
.gitignore: don't ignore rule files in rules/

These are rules we want to track edits to, as well as new and removed
files.

6 weeks agodoc/install: use our recommended header order
Jason Ish [Fri, 20 Jun 2025 15:12:17 +0000 (09:12 -0600)] 
doc/install: use our recommended header order

6 weeks agodoc/userguide: remove example with CentOS 7
Jason Ish [Wed, 18 Jun 2025 17:19:06 +0000 (11:19 -0600)] 
doc/userguide: remove example with CentOS 7

CentOS 7 is EOL.

Ticket: #7749

6 weeks agodoc/userguide: break out package installation
Jason Ish [Wed, 18 Jun 2025 17:16:02 +0000 (11:16 -0600)] 
doc/userguide: break out package installation

Break out RPM, Debian, and Ubuntu package installation into their own
pages.

Also break out other distributions like "Arch" into an "Other" section
with a note about how those packages are not supported by the OISF.

Ticket: #6252
Ticket: #6069

6 weeks agodoc/userguide: add appendix item on eve schema
Jason Ish [Thu, 19 Jun 2025 22:00:40 +0000 (16:00 -0600)] 
doc/userguide: add appendix item on eve schema

Add some basic documentation on our EVE schema, mainly to show users
that it exists.

6 weeks agolua: don't accept a table as a return value from match
Jason Ish [Thu, 19 Jun 2025 17:57:41 +0000 (11:57 -0600)] 
lua: don't accept a table as a return value from match

Remove the half finished support for accepting a table returned from a
Lua rule's match function. This is not documented, not tested, and not
really implemented.

Also, use lua_tointeger to get the return value from the match function
as an integer instead of a float.

Ticket: #6941

6 weeks agodetect/entropy: Clarify when entropy is logged
Jeff Lucovsky [Wed, 18 Jun 2025 13:14:16 +0000 (09:14 -0400)] 
detect/entropy: Clarify when entropy is logged

Clarify when entropy values are logged and associated with non-alert log
records.

6 weeks agodecode: add stats counters for ipv4/ipv6 over ipv4
Juliana Fajardini [Wed, 11 Jun 2025 21:29:58 +0000 (18:29 -0300)] 
decode: add stats counters for ipv4/ipv6 over ipv4

These existed for ipv6 over ipv6, and ipv4 over ipv6, but not for the
ipv4 counterpart.

Task #7758

6 weeks agodecode/ipv6: set packet flow in ip-in-ip
Juliana Fajardini [Wed, 11 Jun 2025 20:54:22 +0000 (17:54 -0300)] 
decode/ipv6: set packet flow in ip-in-ip

Bug #7752

6 weeks agodetect/analyzer: Extend analyzer output with dsize value info
Jeff Lucovsky [Sun, 15 Jun 2025 15:06:58 +0000 (11:06 -0400)] 
detect/analyzer: Extend analyzer output with dsize value info

Issue: 6357

6 weeks agodatasets: remove useless NULL check 13483/head
Eric Leblond [Mon, 16 Jun 2025 09:23:43 +0000 (11:23 +0200)] 
datasets: remove useless NULL check

Coverity did detect that the cleaning code is only reached with
Dataset *set being initialized so the check is useless.

** CID 1649392:       Null pointer dereferences  (REVERSE_INULL)
/src/datasets-context-json.c: 719           in DatajsonGet()
>>>     Null-checking "set" suggests that it may be null, but it has
already been dereferenced on all paths leading to the check.

** CID 1649391:       Null pointer dereferences  (REVERSE_INULL)
/src/datasets.c: 526           in DatasetGet()
>>>     Null-checking "set" suggests that it may be null, but it has
already been dereferenced on all paths leading to the check.

6 weeks agodatasets: remove unreachable code
Eric Leblond [Thu, 12 Jun 2025 09:16:16 +0000 (11:16 +0200)] 
datasets: remove unreachable code

As the DatasetGetOrCreate function is called before the creation
of the hash, it will never be available so we can remove the
cleaning.

6 weeks agoutil/mpm: grow state queue on demand
Philippe Antoine [Tue, 17 Jun 2025 13:06:27 +0000 (15:06 +0200)] 
util/mpm: grow state queue on demand

Ticket: 7678

6 weeks agoutil/mpm: factorize code
Philippe Antoine [Tue, 17 Jun 2025 13:06:08 +0000 (15:06 +0200)] 
util/mpm: factorize code

6 weeks agompm: allocate StateQueue on the heap for ks
Philippe Antoine [Tue, 17 Jun 2025 08:35:55 +0000 (10:35 +0200)] 
mpm: allocate StateQueue on the heap for ks

Completes commit 92fce2fdc069324e6060ce046ca80da6a351573c

Ticket: 6264

6 weeks agodoc/install: windows build documentation
Jason Ish [Mon, 16 Jun 2025 18:26:39 +0000 (12:26 -0600)] 
doc/install: windows build documentation

Ticket: #5911

6 weeks agoconfigure: display if we have npcap support
Jason Ish [Mon, 16 Jun 2025 18:28:10 +0000 (12:28 -0600)] 
configure: display if we have npcap support

6 weeks agorust: fix prototype for AppLayerParserTriggerRawStreamInspection
Philippe Antoine [Tue, 17 Jun 2025 09:37:15 +0000 (11:37 +0200)] 
rust: fix prototype for AppLayerParserTriggerRawStreamInspection

Ticket: 7762

As it modifies the flow indeed

6 weeks agorust: remove unnecessary cbindgen exclusions
Philippe Antoine [Tue, 17 Jun 2025 09:26:04 +0000 (11:26 +0200)] 
rust: remove unnecessary cbindgen exclusions

6 weeks agoutil/mpm: constify arg
Philippe Antoine [Tue, 17 Jun 2025 09:18:47 +0000 (11:18 +0200)] 
util/mpm: constify arg

and make rust version use the correct integer type

Ticket: 7762