]> git.ipfire.org Git - thirdparty/suricata.git/log
thirdparty/suricata.git
2 years agopcap: fix reopen logic 9033/head
Victor Julien [Thu, 18 May 2023 21:18:18 +0000 (23:18 +0200)] 
pcap: fix reopen logic

Bug: #6081.

2 years agopcap/runmodes: silence some info messages
Victor Julien [Thu, 18 May 2023 08:12:21 +0000 (10:12 +0200)] 
pcap/runmodes: silence some info messages

2 years agopcap: free per thread resources
Victor Julien [Thu, 18 May 2023 06:03:31 +0000 (08:03 +0200)] 
pcap: free per thread resources

Bug: #4750.

2 years agopcap/file: minor code cleanup
Victor Julien [Sat, 13 May 2023 05:58:43 +0000 (07:58 +0200)] 
pcap/file: minor code cleanup

2 years agothreads: cleanup decode_pq handling
Victor Julien [Tue, 16 May 2023 20:24:02 +0000 (22:24 +0200)] 
threads: cleanup decode_pq handling

2 years agoversion: start development towards 7.0.0-rc3
Victor Julien [Fri, 16 Jun 2023 07:33:47 +0000 (09:33 +0200)] 
version: start development towards 7.0.0-rc3

2 years agorelease: 7.0.0-rc2; update changelog suricata-7.0.0-rc2
Shivani Bhardwaj [Wed, 14 Jun 2023 17:36:06 +0000 (23:06 +0530)] 
release: 7.0.0-rc2; update changelog

2 years agodoc/userguide: dataset upgrade notes
Jason Ish [Tue, 6 Jun 2023 23:13:57 +0000 (17:13 -0600)] 
doc/userguide: dataset upgrade notes

2 years agoconfig: uncomment datasets configuration
Jason Ish [Tue, 6 Jun 2023 22:23:57 +0000 (16:23 -0600)] 
config: uncomment datasets configuration

Uncomment the datasets configuration for easier editing by users.  The
values are left commented out as their defaults.

2 years agodatasets: flag to disable "write" actions
Jason Ish [Tue, 6 Jun 2023 22:04:56 +0000 (16:04 -0600)] 
datasets: flag to disable "write" actions

Add a new configuration flag, "datasets.rules.allow-write" to control
if rules can contain "save" or "state" rules which allow write access
to the file system.

Ticket: #6123

2 years agoinstall: create runtime data directory
Jason Ish [Tue, 6 Jun 2023 21:32:18 +0000 (15:32 -0600)] 
install: create runtime data directory

On installation, make sure the data directory is created. This will
usually be /var/lib/suricata/data, but otherwise follows the
autoconf/automake instructions.

This directory is for runtime state information, which for now is
datasets but may be expanded in the future.  Suricata already expects
this directory to exist for "state" and "save" datasets, but it has
been up to the user to create it.

2 years agodatasets: don't allow absolute or paths with directory traversal
Jason Ish [Tue, 23 May 2023 21:17:59 +0000 (15:17 -0600)] 
datasets: don't allow absolute or paths with directory traversal

For dataset filenames coming from rules, do not allow filenames that
are absolute or contain a directory traversal with "..". This prevents
datasets from escaping the define data-directory which may allow a bad
rule to overwrite any file that Suricata has permission to write to.

Add a new configuration option,
"datasets.rules.allow-absolute-filenames" to allow absolute filenames
in dataset rules. This will be a way to revert back to the pre 6.0.13
behavior where save/state rules could use any filename.

Ticket: #6118

2 years agodoc/userguide: notes about Lua rules being disabled by default
Jason Ish [Mon, 12 Jun 2023 17:42:59 +0000 (11:42 -0600)] 
doc/userguide: notes about Lua rules being disabled by default

2 years agolua: disable lua rules by default
Jason Ish [Wed, 7 Jun 2023 22:35:53 +0000 (16:35 -0600)] 
lua: disable lua rules by default

To protect against possible supply chain attacks, disable Lua rules by
default. They can be enabled under the "security" section of
suricata.yaml.

Ticket: #6122

2 years agofuzz: fuzz HTTP1 target
Philippe Antoine [Thu, 8 Jun 2023 12:36:50 +0000 (14:36 +0200)] 
fuzz: fuzz HTTP1 target

As we use the name taken from list-app-layer-protos output,
we want http to translate to HTTP1

2 years agodcerpc: maximum number of live transactions also for UDP
Philippe Antoine [Thu, 8 Jun 2023 12:25:01 +0000 (14:25 +0200)] 
dcerpc: maximum number of live transactions also for UDP

Ticket: #6129

Avoids that quadratic complexity gets too bad

2 years agosmtp: handle long lines per direction
Shivani Bhardwaj [Tue, 23 May 2023 04:41:38 +0000 (10:11 +0530)] 
smtp: handle long lines per direction

Issue:
Currently, while handling of long lines, if the line exceeded the limit,
we'd set a variable state->discard_till_lf which will be reset in the
later stages based on the data that arrives. However, because there was
one variable per state, this meant that a later stage in the other
direction could also modify it which is incorrect.

Fix:
Use separate variables for each direction.

Bug 6053

2 years agosmtp: handle following cmd if LF was found in long line
Shivani Bhardwaj [Sat, 6 May 2023 11:46:30 +0000 (17:16 +0530)] 
smtp: handle following cmd if LF was found in long line

If a long line had LF post the limit, it should be considered complete
and not wait for the next line to complete it. However, currently, any
following lines were skipped which could sometimes also be important
commands for the entire transaction.

Fix this by setting a flag in case we're truncating a long line but
after having found the LF character.

Bug 5989

2 years agosmtp: add function docs
Shivani Bhardwaj [Tue, 30 May 2023 07:20:57 +0000 (12:50 +0530)] 
smtp: add function docs

2 years agosmtp: handle DATA mode in middle of input parsing
Shivani Bhardwaj [Tue, 4 Apr 2023 06:32:03 +0000 (12:02 +0530)] 
smtp: handle DATA mode in middle of input parsing

Before:
If the input was such that we'd enter DATA mode in the middle, the
entire data would be passed through SMTPGetLine fn and be processed with
line limits etc in place.

After:
Since we don't want any limits to be enforced on DATA, we pass it to
SMTPPreProcessCommands fn to take care of it differently from the
commands.

Bug 5981

2 years agostreaming/buffer: set errno in allocators 9021/head
Victor Julien [Tue, 13 Jun 2023 09:56:17 +0000 (11:56 +0200)] 
streaming/buffer: set errno in allocators

Add wrappers for the default allocators to set SC_ENOMEM.

The stream reassembly wrappers can set both SC_ENOMEM (alloc failed)
and SC_ELIMIT (memcap reached).

2 years agostreaming/buffer: turn BUG_ON's into validate checks
Victor Julien [Tue, 13 Jun 2023 09:25:20 +0000 (11:25 +0200)] 
streaming/buffer: turn BUG_ON's into validate checks

2 years agostream: update insert error checking
Victor Julien [Thu, 4 May 2023 13:27:03 +0000 (15:27 +0200)] 
stream: update insert error checking

2 years agostreaming: use error codes to indicate error reason
Victor Julien [Thu, 4 May 2023 13:04:24 +0000 (15:04 +0200)] 
streaming: use error codes to indicate error reason

2 years agoerror: SC_ELIMIT for when a limit is reached
Victor Julien [Thu, 4 May 2023 13:02:28 +0000 (15:02 +0200)] 
error: SC_ELIMIT for when a limit is reached

2 years agoexception/policy: fix midstream default handling
Victor Julien [Tue, 13 Jun 2023 07:52:30 +0000 (09:52 +0200)] 
exception/policy: fix midstream default handling

2 years agoexception/policy: minor code cleanup
Victor Julien [Tue, 13 Jun 2023 07:51:48 +0000 (09:51 +0200)] 
exception/policy: minor code cleanup

2 years agostream/tcp: don't accept pass-packet policy
Juliana Fajardini [Tue, 30 May 2023 13:43:49 +0000 (10:43 -0300)] 
stream/tcp: don't accept pass-packet policy

This is no longer valid for midstream exception policies.

Part of
Bug #5825

2 years agostream/tcp: re-enable midstream-policy usage
Juliana Fajardini [Tue, 30 May 2023 13:41:49 +0000 (10:41 -0300)] 
stream/tcp: re-enable midstream-policy usage

We were always setting it to ignore, due to bug 5825.

The engine will now issue an initialization error if an invalid value
is passed in the configuration file for midstream exception policy.

'pass-packet' or 'drop-packet' are never valid, as the midstream policy
concerns the whole flow, not making sense for just a packet.

If midstream is enabled, only two actual config values are allowed:
'ignore' and 'pass-flow', both in IDS and in IPS mode. In default mode
('auto' or if no policy is defined), midstream-policy is set to
'ignore'. All other values will lead to initialization error.

In IDS mode, 'drop-flow' will also lead to initialization error.

Part of
Bug #5825

2 years agoexceptions: extract 'auto' check to function
Juliana Fajardini [Thu, 1 Jun 2023 01:52:48 +0000 (22:52 -0300)] 
exceptions: extract 'auto' check to function

Part of
Bug #5825

2 years agoexceptions: use mix of logconfig/info/warning
Juliana Fajardini [Thu, 1 Jun 2023 23:33:18 +0000 (20:33 -0300)] 
exceptions: use mix of logconfig/info/warning

Use a mix of SCLogConfig, Warning and Info.
This mix works as follows: when something unnexpected for the user
happens - for instance, the engine ignoring an invalid config value, we
use warning. For indicating the value for the master switch, which
happens only once, we use Info. For all the other cases, we use
SCLogConfig.

It is possible that SCLogConfig isn't showing at the moment, this is a
possible bug to investigate further.

Related to
Bug #5825

2 years agoexceptions: parse config values, don't post process
Juliana Fajardini [Wed, 31 May 2023 14:56:43 +0000 (11:56 -0300)] 
exceptions: parse config values, don't post process

Get the enum values from the config file. Update the new extracted
functions. Post-process the config values based on runmode and policy.
Also handle 'auto' enum value in these.

Related to
Bug #5825

2 years agoexceptions/midstream: parse midstream policy alone
Juliana Fajardini [Mon, 29 May 2023 19:55:00 +0000 (16:55 -0300)] 
exceptions/midstream: parse midstream policy alone

As the midstream exception policy has its own specific scenarios, have a
dedicated function to parse and process its config values, and check for
midstream enabled when needed.

Related to
Bug #5825

2 years agoexceptions: refactor exception policy parse fn
Juliana Fajardini [Mon, 29 May 2023 18:26:22 +0000 (15:26 -0300)] 
exceptions: refactor exception policy parse fn

Split up ExceptionPolicyParse to try to improve readability.

Related to
Bug #5825

2 years agouserguide: update exception policy behaviors table
Juliana Fajardini [Mon, 24 Apr 2023 19:42:34 +0000 (16:42 -0300)] 
userguide: update exception policy behaviors table

Some exception policies can only be applied to the triggering packet or
only make sense considering the whole flow. Highlight such cases in the
table showing each exception policy.

Related to
Bug #5825

2 years agodoc: add midstream scenarios for exception policy
Juliana Fajardini [Tue, 18 Apr 2023 23:09:16 +0000 (20:09 -0300)] 
doc: add midstream scenarios for exception policy

The different interactions between midstream pick-up sessions and the
exception policy can be quite difficult to visualize. Add a section for
that in the userguide.

Related to
Bug #5825

2 years agomisc: fix typos, doc, update copyright years
Juliana Fajardini [Fri, 17 Feb 2023 20:34:09 +0000 (17:34 -0300)] 
misc: fix typos, doc, update copyright years

Updated FlowGetNew documentation, where it said NULL was only returned
in case of error.

2 years agodefrag: clean up existing stats counters
Juliana Fajardini [Thu, 30 Mar 2023 13:40:46 +0000 (10:40 -0300)] 
defrag: clean up existing stats counters

7a044a99ee14101fbc removed the lines that incremented these defrag
counters, but kept the entities themselves. This commit removes counters
that we judge too complex to maintain, given the current state of the
code, and re-adds incrementing max_hit (memcap related).

Related to
Task #5816

2 years agoschema: add missing flow event property: emergency
Juliana Fajardini [Mon, 20 Mar 2023 19:04:01 +0000 (16:04 -0300)] 
schema: add missing flow event property: emergency

2 years agorust: fix unit test link error on Rust 1.70 9009/head
Jason Ish [Mon, 12 Jun 2023 16:29:00 +0000 (10:29 -0600)] 
rust: fix unit test link error on Rust 1.70

Rust 1.70 appears to now link code on both branches of `if cfg!(test)`
now causing Rust unit tests to fail as that pattern was used to
disable functions only available when linked with the Suricata C code.

To work-around this issue, provide two versions of the `new` function,
one for unit tests and one when running as an application.

2 years agoapp-layer: improve/fix updates logic
Victor Julien [Thu, 8 Jun 2023 16:37:44 +0000 (18:37 +0200)] 
app-layer: improve/fix updates logic

In 23323a961fac ("app-layer: reduce app cleanup and output-tx calls"), flag
was set per packet updating the app-layer state. However this was missing a
common pattern: in IDS mode most updates are done in the opposite direction
of the traffic due to updates getting triggered by ACK's. This meant that
file store processing might not happen for a long time, or at all. Also,
app layer cleanup might not be called, which includes file pruning.

This patch sets per flow set of flags to indicate app layer is (potentially)
updated. It sets this per direction, based on how the parsers were invoked.
If an ACK triggers an app update, the flow is tagged for the opposite
direction and the next packet in that direction triggers output and cleanup.

Fixes: 23323a961fac ("app-layer: reduce app cleanup and output-tx calls")
Bug: #6120.

2 years agooutput/tx: minor code cleanup
Victor Julien [Thu, 8 Jun 2023 16:41:57 +0000 (18:41 +0200)] 
output/tx: minor code cleanup

2 years agohttp: htp_table_get_index does not return NULL 9001/head
Philippe Antoine [Wed, 7 Jun 2023 14:08:14 +0000 (16:08 +0200)] 
http: htp_table_get_index does not return NULL

if the index is correct

2 years agohttp1: implement http.request_header
Philippe Antoine [Thu, 23 Mar 2023 09:43:07 +0000 (10:43 +0100)] 
http1: implement http.request_header

So that it is generic for HTTP1 and HTTP2

Ticket: #5780

2 years agodetect/http2: do not escape ':' in header name or value
Philippe Antoine [Wed, 7 Jun 2023 14:17:17 +0000 (16:17 +0200)] 
detect/http2: do not escape ':' in header name or value

for keywords http.request_header and http.response_header

Ticket: #5780

2 years agohttp2: rename http2.header to http.request_header
Philippe Antoine [Thu, 12 Jan 2023 16:03:44 +0000 (17:03 +0100)] 
http2: rename http2.header to http.request_header

Or http.response_header based on the direction

http2.header had a different behavior than http.header and this was
confusing.

Ticket: #5780

2 years agodetect: Fix FTP bounce detection IP address comparison
Cole Dishington [Sun, 14 May 2023 20:03:23 +0000 (08:03 +1200)] 
detect: Fix FTP bounce detection IP address comparison

Fix the FTP bounce IP address comparison by only converting the IP
parsed from the FTP payload to network order.

Bug: #6087

2 years agorust/pgsql: remove unused/unconstructed enum variants
Philippe Antoine [Sun, 14 May 2023 15:05:18 +0000 (17:05 +0200)] 
rust/pgsql: remove unused/unconstructed enum variants

2 years agorust: remove duplicate constants definitions in C
Philippe Antoine [Sat, 29 Apr 2023 14:59:55 +0000 (16:59 +0200)] 
rust: remove duplicate constants definitions in C

2 years agorust: define AppLayerEventType only in rust
Philippe Antoine [Thu, 27 Apr 2023 13:04:38 +0000 (15:04 +0200)] 
rust: define AppLayerEventType only in rust

And detect.h does no longer depend on app-layer-events.h

2 years agorust: remove unused
Philippe Antoine [Thu, 20 Apr 2023 06:49:48 +0000 (08:49 +0200)] 
rust: remove unused

2 years agostream/reassemble: Include pool item count msg
Jeff Lucovsky [Thu, 8 Jun 2023 14:27:02 +0000 (10:27 -0400)] 
stream/reassemble: Include pool item count msg

Issue: 5563

This commit adds the segment pool item count in the summary DEBUG
message.

2 years agostream/cache: Return sessions to correct pool
Jeff Lucovsky [Thu, 8 Jun 2023 14:25:30 +0000 (10:25 -0400)] 
stream/cache: Return sessions to correct pool

Issue: 5563

This commit fixes the release of TCP resources. The sessions were being
returned to the segment thread pool instead of the sessions pool.

2 years agopool: Use bool return type
Jeff Lucovsky [Sat, 3 Jun 2023 14:04:33 +0000 (10:04 -0400)] 
pool: Use bool return type

Issue: 5563

This commit changes PoolDataPreAllocated to return a bool instead of an
int.

2 years agogithub-ci: check for suricata-update example configuration files
Jason Ish [Thu, 8 Jun 2023 18:26:53 +0000 (12:26 -0600)] 
github-ci: check for suricata-update example configuration files

Check that the Suricata-Update example configuration files are
installed.

2 years agosuricata-update: install sample configuration files
Jason Ish [Thu, 8 Jun 2023 18:23:05 +0000 (12:23 -0600)] 
suricata-update: install sample configuration files

With the move to installing Suricata-Update files from Suricata
Makefile's, the sample configuration files were forgotten.

Ticket: #6132

2 years agodoc: GitHub PRs workflow 8994/head
Philippe Antoine [Thu, 18 May 2023 17:53:27 +0000 (19:53 +0200)] 
doc: GitHub PRs workflow

2 years agouserguide/install: add info on arch-based installs
Jeremy MountainJohnson [Mon, 1 May 2023 17:04:26 +0000 (12:04 -0500)] 
userguide/install: add info on arch-based installs

Add Arch AUR information for installation on Arch-based distros.

2 years agodoc: upgrade guide for logging http custom headers
Philippe Antoine [Tue, 6 Jun 2023 19:54:49 +0000 (21:54 +0200)] 
doc: upgrade guide for logging http custom headers

Ticket: #5320

2 years agodoc: add missing rule to engine-analysis section
Juliana Fajardini [Wed, 7 Jun 2023 19:13:24 +0000 (16:13 -0300)] 
doc: add missing rule to engine-analysis section

The first report didn't have an example rule to go with.

2 years agosource-pcap-file: include unlink error in warning message
Long Doan [Tue, 6 Jun 2023 22:08:06 +0000 (00:08 +0200)] 
source-pcap-file: include unlink error in warning message

2 years agooutput/snmp: log version from tx
Philippe Antoine [Mon, 5 Jun 2023 15:04:04 +0000 (17:04 +0200)] 
output/snmp: log version from tx

and not the one from state

If a SNMP flow starts with a V2 version transaction,
then there is a V3i version transaction,
we will now log V3 for the second transaction

2 years agoexception: in ids mode, only REJECT the packet
Juliana Fajardini [Mon, 5 Jun 2023 16:02:26 +0000 (13:02 -0300)] 
exception: in ids mode, only REJECT the packet

In case of 'EXCEPTION_POLICY_REJECT', we were applying the same behavior
regardless of being in IDS or IPS mode.
This meant that (at least) the 'flow.action' was changed to drop when we
hit an exception policy in IDS mode.

Bug #6109

2 years agodecode-ipv6: Set IPv6 proto incase of ext header parsing error
Cole Dishington [Wed, 24 May 2023 00:39:33 +0000 (12:39 +1200)] 
decode-ipv6: Set IPv6 proto incase of ext header parsing error

Set the IPv6 packet proto before parsing the ext headers, similar to
decode-ipv4, incase of an ext header parsing error. Otherwise
rule decode-events are not triggered for packets encapsulated in IPv6.

Bug: #6086.

2 years agoftp: remove unnecessary code
Shivani Bhardwaj [Mon, 5 Jun 2023 10:48:15 +0000 (16:18 +0530)] 
ftp: remove unnecessary code

2 years agoftp: mark LF found per line
Shivani Bhardwaj [Mon, 5 Jun 2023 10:47:37 +0000 (16:17 +0530)] 
ftp: mark LF found per line

Currently, there is no way to mark if LF was found and then the line was
truncated. It becomes difficult to spot in the callers whether the line
was truncated despite LF being found or not. So, label it clearly with a
variable.

2 years agoftp: separate truncated line markers
Shivani Bhardwaj [Mon, 5 Jun 2023 10:45:51 +0000 (16:15 +0530)] 
ftp: separate truncated line markers

So far, we store one variable in state to hold whether we want to
discard a long line till LF irrespective of direction. This means that a
long command to the client followed by a regular command w LF can be
considered as one long line which is incorrect.

Bug 6054

2 years agowindows: add -lntdll to Windows builds 8990/head
Jason Ish [Wed, 7 Jun 2023 15:22:32 +0000 (09:22 -0600)] 
windows: add -lntdll to Windows builds

Rust 1.70 has introduced some possible issues between LLVM and gcc
causing link errors that are fixed by explicitly adding -lntdll.

Thanks to https://github.com/extendr/rextendr/pull/285 for the fix.

2 years agostreaming/buffer: handle and document slide errors
Victor Julien [Wed, 7 Jun 2023 18:16:00 +0000 (20:16 +0200)] 
streaming/buffer: handle and document slide errors

Slide error may happen if the region we're sliding starts to overlap
with the next region. If we can't temporary grow the current region
to merge with the next region, keep the regions separate.

2 years agostreaming/buffer: minor debug fixup
Victor Julien [Wed, 7 Jun 2023 05:39:26 +0000 (07:39 +0200)] 
streaming/buffer: minor debug fixup

2 years agostreaming/buffer: fix buf_offset getting out of sync
Victor Julien [Wed, 7 Jun 2023 05:38:52 +0000 (07:38 +0200)] 
streaming/buffer: fix buf_offset getting out of sync

During consolidation of regions, buf_offset could get out of sync if
the region was grown on the left side.

To fix, reset it and let "sbb slide" logic correct it.

Bug: #6117.

2 years agostreaming/buffer: fix sliding region into next
Victor Julien [Tue, 6 Jun 2023 10:17:16 +0000 (12:17 +0200)] 
streaming/buffer: fix sliding region into next

When sliding a region it could start to overlap with the next region.
This case wasn't handled, causing validation checks to trigger.

This patch adds support for this, where largest region will be expanded
to fit both region and both regions will be consolidated into it.

Bug: #6066.

2 years agostreaming/buffer: move util code for reusability
Victor Julien [Tue, 6 Jun 2023 10:09:36 +0000 (12:09 +0200)] 
streaming/buffer: move util code for reusability

2 years agooutput/rfb: remove unused function parameters 8965/head
Philippe Antoine [Mon, 5 Jun 2023 08:03:04 +0000 (10:03 +0200)] 
output/rfb: remove unused function parameters

2 years agooutput/mqtt: remove unused function parameters
Philippe Antoine [Mon, 5 Jun 2023 08:01:33 +0000 (10:01 +0200)] 
output/mqtt: remove unused function parameters

2 years agooutput/krb5: remove unused function parameters
Philippe Antoine [Mon, 5 Jun 2023 08:00:12 +0000 (10:00 +0200)] 
output/krb5: remove unused function parameters

2 years agooutput/ftp: remove unused function parameters
Philippe Antoine [Thu, 11 May 2023 08:51:59 +0000 (10:51 +0200)] 
output/ftp: remove unused function parameters

2 years agooutput/dns: remove unused function parameters
Philippe Antoine [Thu, 11 May 2023 08:30:28 +0000 (10:30 +0200)] 
output/dns: remove unused function parameters

2 years agooutput/smtp: remove unused function parameters
Philippe Antoine [Thu, 11 May 2023 08:04:48 +0000 (10:04 +0200)] 
output/smtp: remove unused function parameters

2 years agohttp: complete multipart data on open
Philippe Antoine [Wed, 17 May 2023 16:15:02 +0000 (18:15 +0200)] 
http: complete multipart data on open

Take as much as we can when opening, by making sure that the
boundary is not present

2 years agosmb: fix data padding logic in writeAndX parser
Lancer Cheng [Mon, 29 May 2023 12:07:08 +0000 (12:07 +0000)] 
smb: fix data padding logic in writeAndX parser

Bug: #6008

2 years agosmb: fix wrong data offset when wct = 12
Lancer Cheng [Mon, 22 May 2023 09:16:34 +0000 (09:16 +0000)] 
smb: fix wrong data offset when wct = 12

Bug: #6008

2 years agoflow: optionally use livedev for hash
Philippe Antoine [Thu, 28 Apr 2022 07:49:38 +0000 (09:49 +0200)] 
flow: optionally use livedev for hash

So that in a setup with different interfaces capturing different
networks, flows do not get mixed up

Ticket: #5270

2 years agoflow: make FlowGetExistingFlowFromHash static
Philippe Antoine [Thu, 28 Apr 2022 07:38:24 +0000 (09:38 +0200)] 
flow: make FlowGetExistingFlowFromHash static

For easier reasoning about the code

2 years agodevice: limit device id to uint16_t
Philippe Antoine [Thu, 28 Apr 2022 06:58:47 +0000 (08:58 +0200)] 
device: limit device id to uint16_t

Meaning that we support 65535 live devices at the most

2 years agogeneral/typo: Correct misc. typos
Jeff Lucovsky [Sat, 27 Aug 2022 14:09:28 +0000 (10:09 -0400)] 
general/typo: Correct misc. typos

2 years agodecode/vlan: Remove unused macros/functions
Jeff Lucovsky [Sat, 27 Aug 2022 13:16:46 +0000 (09:16 -0400)] 
decode/vlan: Remove unused macros/functions

This commit removes unused functions and macros related to fetching VLAN
values.

2 years agodecode/vlan: Decode upto 3 layers of VLAN
Jeff Lucovsky [Sun, 7 Aug 2022 19:53:21 +0000 (15:53 -0400)] 
decode/vlan: Decode upto 3 layers of VLAN

Issue: 2816

This commit increase the number of VLAN layers supported by Suricata
from 2 to 3. 3-layers are dubbed "Q-in-Q-in-Q".

Note that 3 layers are not compliant with any existing standard but are
often seen in larger deployments.

2 years agojson/schema: Add additional VLAN layer stat
Jeff Lucovsky [Fri, 5 Aug 2022 13:31:59 +0000 (09:31 -0400)] 
json/schema: Add additional VLAN layer stat

Issue: 2816

This commit extends the JSON schema with the additional VLAN stat for
tracking VLAN encapsulated packets with 3 levels.

2 years agohttp2: avoid quadratic complexity in headers
Philippe Antoine [Wed, 31 May 2023 12:53:28 +0000 (14:53 +0200)] 
http2: avoid quadratic complexity in headers

When adding an element to the dynamic headers table, the oldest
ones may get evicted. When multiple elements get evicted, they
should get evicted all at once with drain, instead of one by one
as there will be a massive move each time.

Ticket: #6103

2 years agodebug: fix list-x command line options with debug
Philippe Antoine [Tue, 23 May 2023 12:06:26 +0000 (14:06 +0200)] 
debug: fix list-x command line options with debug

Debug validation checks that engine is either IPS or IDS.
But listing keywords does not care.
So, setting ids mode

Ticket: #6089

2 years agodoc: add DPDK Bond PMD docs
Lukas Sismis [Tue, 30 May 2023 14:30:27 +0000 (16:30 +0200)] 
doc: add DPDK Bond PMD docs

Ticket: #6099

2 years agodpdk: add support for DPDK Bond PMD
Lukas Sismis [Thu, 25 May 2023 12:02:15 +0000 (14:02 +0200)] 
dpdk: add support for DPDK Bond PMD

Ticket: #6099

2 years agodpdk: add linker flag for DPDK Bond library
Lukas Sismis [Thu, 25 May 2023 12:00:19 +0000 (14:00 +0200)] 
dpdk: add linker flag for DPDK Bond library

Header checking (AC_CHECK_HEADER) did not work as
DPDK 19.11 included rte_eth_bond.h file even if net/bonding
driver was disabled. However, it was still not available in
ldconfig configuration. For this reason Bond PMD is checked with
ldconfig tool.
However when installing the DPDK library manually, the user needs to
update the entries in ldconfig to be able to find the Bond PMD.

Ticket: #6099

2 years agodpdk: add device name querying function
Lukas Sismis [Wed, 31 May 2023 11:44:21 +0000 (13:44 +0200)] 
dpdk: add device name querying function

2 years agodpdk: add debug dump of RX offload capabilities
Lukas Sismis [Thu, 25 May 2023 11:59:44 +0000 (13:59 +0200)] 
dpdk: add debug dump of RX offload capabilities

2 years agodpdk: separate i40e prestop actions from DPKD 19.11
Lukas Sismis [Fri, 2 Jun 2023 13:59:52 +0000 (15:59 +0200)] 
dpdk: separate i40e prestop actions from DPKD 19.11

In DPDK 19.11 Suricata does not setup RSS on i40e driver
with rte_flow. As a result, it should not be deinitializing
RSS configuration with rte_flow as well.

2 years agodpdk: refactor i40e RSS hash function
Lukas Sismis [Thu, 25 May 2023 11:57:57 +0000 (13:57 +0200)] 
dpdk: refactor i40e RSS hash function

Setting rss_conf->rss_key to NULL and rss_key_len
to zero avoids warnings about register changes
when setting up RSS configuration through RTE flows.

2 years agodpdk: minor refactoring in error handling and variable declaration
Lukas Sismis [Thu, 25 May 2023 11:56:27 +0000 (13:56 +0200)] 
dpdk: minor refactoring in error handling and variable declaration

2 years agoflow/worker: minor refactor for app-layer callsite 8951/head
Victor Julien [Fri, 2 Jun 2023 09:08:29 +0000 (11:08 +0200)] 
flow/worker: minor refactor for app-layer callsite