]> git.ipfire.org Git - thirdparty/suricata.git/log
thirdparty/suricata.git
5 weeks agohtp: use transactions right get function 13772/head
Philippe Antoine [Mon, 7 Jul 2025 20:25:13 +0000 (22:25 +0200)] 
htp: use transactions right get function

Not the VecDeque one

Ticket: 7803

5 weeks agodetect/dsize: define offset in edge case
Philippe Antoine [Mon, 7 Jul 2025 19:25:16 +0000 (21:25 +0200)] 
detect/dsize: define offset in edge case

Ticket: 7802

5 weeks agooutput/alert-debug: do not return on app-layer
Philippe Antoine [Fri, 29 Aug 2025 11:18:04 +0000 (13:18 +0200)] 
output/alert-debug: do not return on app-layer

just continue, so that we call aft->file_ctx->Write

Ticket: 4178

5 weeks agodoc/devguide: section with conceptualized steps for adding app-layer
Philippe Antoine [Thu, 26 Jun 2025 13:54:00 +0000 (15:54 +0200)] 
doc/devguide: section with conceptualized steps for adding app-layer

Ticket: 6840

5 weeks agoschema/description: capitalize initial letters 13767/head
Juliana Fajardini [Tue, 26 Aug 2025 21:30:39 +0000 (18:30 -0300)] 
schema/description: capitalize initial letters

For existing descriptions that weren't like that, yet.

5 weeks agoschema: add descriptions for flow stats counters
Juliana Fajardini [Fri, 8 Aug 2025 15:42:38 +0000 (12:42 -0300)] 
schema: add descriptions for flow stats counters

Task #7794

5 weeks agodoc/lualib: fix wrong tuple section markdown in flowlib
Tommy Wang [Tue, 26 Aug 2025 13:15:25 +0000 (21:15 +0800)] 
doc/lualib: fix wrong tuple section markdown in flowlib

Sections had wrong levels due to wrong markdown.

5 weeks agodoc/lualib: fix flow timestamps return value order
Tommy Wang [Sat, 23 Aug 2025 00:50:22 +0000 (08:50 +0800)] 
doc/lualib: fix flow timestamps return value order

Task #7854

5 weeks agostream: remove incorrect defensive check
Shivani Bhardwaj [Thu, 28 Aug 2025 02:36:44 +0000 (08:06 +0530)] 
stream: remove incorrect defensive check

As a part of the commit d096b98 a defensive check was added stating that
the stream must have EOF flag set if it is in TCP_CLOSING state or
above. However, this led to a false positive reported by oss-fuzz whose
analysis showed that this does not hold true for TCP_CLOSING state. It
does hold true only for TCP_CLOSED or if packet has PKT_PSEUDO_STREAM_END
set.
TCP_CLOSING state correspond to an established flow hence the correct
course of action is to remove the assertion.

Bug 7636

Co-authored-by: Philippe Antoine <pantoine@oisf.net>
5 weeks agodetect/integers: support kibibyte unit
Philippe Antoine [Wed, 27 Aug 2025 19:14:24 +0000 (21:14 +0200)] 
detect/integers: support kibibyte unit

Ticket: 7869

5 weeks agodetect/integers: document usage of units
Philippe Antoine [Wed, 30 Jul 2025 15:24:35 +0000 (17:24 +0200)] 
detect/integers: document usage of units

Ticket: 7190

5 weeks agodetect/integer: support missing modes for u8 prefilter
Philippe Antoine [Thu, 31 Jul 2025 06:52:22 +0000 (08:52 +0200)] 
detect/integer: support missing modes for u8 prefilter

Ticket: 7865

<=, >=, and != were missing

Also warns if an unimplemented mode is tried

5 weeks agohttp: generate no anomaly for identity encoding 13755/head
Philippe Antoine [Sun, 24 Aug 2025 20:03:16 +0000 (22:03 +0200)] 
http: generate no anomaly for identity encoding

Ticket: 7843

5 weeks agodocs: fix deprecated inclusion of rtd theme path
Theo Buehler [Fri, 22 Aug 2025 05:58:41 +0000 (07:58 +0200)] 
docs: fix deprecated inclusion of rtd theme path

Since userguide/conf.py uses the deprecated get_html_theme_path(),
sphinx emits a warning which breaks the build as warnings are treated
as errors.

Issue: 7859

5 weeks agoutil: Fix a hash table collision bug
Charlie Vigue [Tue, 22 Jul 2025 08:55:45 +0000 (08:55 +0000)] 
util: Fix a hash table collision bug

In util-hash.c there was some behavior that is unexpected and likely
incorrect. To see this behavior, create a hash table 32 entries wide
and use the default hash function. Then add a short string “abc”,
observe the string is stored properly. Now remove a string “iln”, and
observe string “abc” is no longer in the table.

This is because the hash function is not properly handling collisions in
some edge cases.

Includes new unit test:

- UT verifies that the hash function generates a collision for
  the selected test data. This must be true for the bug to be present.
  Then UT demonstrates the bug by adding two items to the hash table
  that collide, and then removing one of them 2x. The bug is that the
  other value is removed as well.

Bug #7828 --> https://redmine.openinfosecfoundation.org/issues/7828

Signed-off-by: Charlie Vigue <charlie.vigue@openvpn.com>
5 weeks agodetect-file-hash: drop redundant rule_file NULL check
Boris Tonofa [Mon, 30 Jun 2025 13:10:15 +0000 (16:10 +0300)] 
detect-file-hash: drop redundant rule_file NULL check

de_ctx->rule_file is never NULL inside DetectFileHashParse(); add a comment
stating this fact and remove the superfluous NULL guard.

No functional change – the patch only clarifies the code and trims a few
lines of dead code.

Bug 7769

6 weeks agoschema/decoder: add descriptions for stats counters 13743/head
Juliana Fajardini [Thu, 14 Aug 2025 18:21:51 +0000 (15:21 -0300)] 
schema/decoder: add descriptions for stats counters

Task #7793

6 weeks agoschema/arp: fix invalid pkt event output
Juliana Fajardini [Thu, 21 Aug 2025 16:51:41 +0000 (13:51 -0300)] 
schema/arp: fix invalid pkt event output

Task #7857

6 weeks agodpdk: fix parsing of DPDK EAL argument options
Adam Kiripolsky [Tue, 19 Aug 2025 14:07:34 +0000 (16:07 +0200)] 
dpdk: fix parsing of DPDK EAL argument options

Fix parsing of DPDK EAL argument options taken from suricata.yaml.

Ticket: 7856

6 weeks agodoc/exceptions: fix wrong section markdown
Juliana Fajardini [Mon, 18 Aug 2025 13:51:48 +0000 (10:51 -0300)] 
doc/exceptions: fix wrong section markdown

Sections had wrong levels due to wrong markdown.

6 weeks agodoc/from_base64: Emphasize keyword only values
Jeff Lucovsky [Mon, 18 Aug 2025 12:27:43 +0000 (08:27 -0400)] 
doc/from_base64: Emphasize keyword only values

Emphasize that specifying the keyword only will result in the defaults
for each option to be used.

Issue: 7853

6 weeks agodetect/from_base64: Support keyword w/no opts
Jeff Lucovsky [Sun, 17 Aug 2025 14:23:44 +0000 (10:23 -0400)] 
detect/from_base64: Support keyword w/no opts

Issue: 7853

Support the use of `from_base64` with no optional values. In this case,
the default values for:
- mode RFC4648
- offset: 0
- bytes: buffer size
will be used.

6 weeks agomisc: fix typos 13734/head
Jeff Lucovsky [Thu, 31 Jul 2025 14:31:21 +0000 (10:31 -0400)] 
misc: fix typos

Fix typos in src/detect-engine.c

Issue: 7819

6 weeks agodetect/mt: Prevent deadlock when adding tenants
Jeff Lucovsky [Wed, 30 Jul 2025 13:34:07 +0000 (09:34 -0400)] 
detect/mt: Prevent deadlock when adding tenants

This commit modifies the call path for registering MT tenants to avoid
deadlocks on the master->lock

When performing tenant operations, e.g., using suricatasc to send a
register-tenant command, a deadlock occurs when

- DetectEngineMTApply: acquires master->lock
- Calls DetectEngineReloadThreads
- Within DetectEngineReloadThreads, calls DetectEngineMultiTenantEnabled
- Which first acquires master->lock

Commit 2bea5af introduced changes to the master->lock usage leading to
the deadlock situation.

Issue: 7819

6 weeks agogithub-ci: add Debian 13 job with xdp and vectorscan
Victor Julien [Wed, 13 Aug 2025 13:49:11 +0000 (15:49 +0200)] 
github-ci: add Debian 13 job with xdp and vectorscan

6 weeks agomisc: add rust analyzer and sphinx to shell.nix
Eric Leblond [Thu, 7 Aug 2025 21:14:03 +0000 (23:14 +0200)] 
misc: add rust analyzer and sphinx to shell.nix

This allows to have the LSP server present and permits to build the
documentation.

8 weeks agorust: fix mismatched_lifetime_syntaxes warning 13710/head
Jason Ish [Thu, 7 Aug 2025 15:21:31 +0000 (09:21 -0600)] 
rust: fix mismatched_lifetime_syntaxes warning

Fix new warning present in Rust 1.89.

warning: hiding a lifetime that's elided elsewhere is confusing
   --> src/ldap/types.rs:191:30
    = help: the same lifetime is referred to in inconsistent ways, making the signature confusing
    = note: `#[warn(mismatched_lifetime_syntaxes)]` on by default
help: use `'_` for type paths

8 weeks agodetect/port: add BUG_ON on impossible condition
Shivani Bhardwaj [Tue, 5 Aug 2025 10:32:16 +0000 (16:02 +0530)] 
detect/port: add BUG_ON on impossible condition

to assist Coverity in assessing the state of x correctly.

8 weeks agodetect/port: clean up already initialized vars
Shivani Bhardwaj [Tue, 5 Aug 2025 10:31:39 +0000 (16:01 +0530)] 
detect/port: clean up already initialized vars

8 weeks agoengine/analyzer: write rule failure report to correct file 13701/head
Shivani Bhardwaj [Thu, 17 Jul 2025 06:33:17 +0000 (12:03 +0530)] 
engine/analyzer: write rule failure report to correct file

The failure report was always just written to rules_fast_pattern.txt. In
case that setting is disabled or there's nothing fast-pattern related,
the report should be written to the usual rules_analysis.txt.

Bug 7821

8 weeks agoengine/analyzer: check if file pointer exists before writing
Shivani Bhardwaj [Thu, 17 Jul 2025 06:31:07 +0000 (12:01 +0530)] 
engine/analyzer: check if file pointer exists before writing

de_ctx->ea->fp_engine_analysis_fp is only initialized if
engine-analysis.rules-fast-pattern is enabled in the configuration. If
this config param is missing, this leads to segfault.

Bug 7822

2 months agodetect/engine: simplify stats counters registration 13693/head
Juliana Fajardini [Mon, 28 Jul 2025 22:55:39 +0000 (19:55 -0300)] 
detect/engine: simplify stats counters registration

2 months 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

2 months 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>
2 months 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

2 months 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

2 months 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

2 months 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

2 months 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

2 months 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

2 months 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

2 months 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)

2 months 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.

2 months 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.

2 months 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.

2 months 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.

2 months 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

2 months 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.

2 months 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.

2 months 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.

2 months 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

2 months 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

2 months 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

2 months 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

2 months 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

2 months 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

2 months 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

2 months 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

2 months 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

2 months 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

2 months 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

2 months 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.]

2 months 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

2 months 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

2 months 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.

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

2 months 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

2 months 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

2 months 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

3 months 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.

3 months 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

3 months 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.

3 months 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

3 months 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>
3 months 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

3 months 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.

3 months 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.

3 months 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

3 months 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

3 months 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

3 months 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

3 months 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

3 months 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

3 months 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

3 months 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

3 months 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

3 months 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

3 months 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.

3 months 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

3 months 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

3 months 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

3 months 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.

3 months 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

3 months 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

3 months 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.

3 months 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

3 months 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

3 months 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

3 months 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

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

Ticket: 6566