]> git.ipfire.org Git - thirdparty/suricata.git/log
thirdparty/suricata.git
5 years agogeneral: Convert _Bool to bool 4568/head
Jeff Lucovsky [Tue, 29 Oct 2019 10:24:53 +0000 (11:24 +0100)] 
general: Convert _Bool to bool

This commit addresses task 3167 and changes usages of '_Bool` to `bool`.
The latter is included from `suricata-common.h`

5 years agodoc/userguide: Update for dump-features
Jeff Lucovsky [Sat, 21 Dec 2019 16:22:34 +0000 (11:22 -0500)] 
doc/userguide: Update for dump-features

5 years agodetect/feature: Support --dump-features
Jeff Lucovsky [Sat, 21 Dec 2019 16:16:31 +0000 (11:16 -0500)] 
detect/feature: Support --dump-features

5 years agodetect: update version comment
Jeff Lucovsky [Sat, 21 Dec 2019 16:15:42 +0000 (11:15 -0500)] 
detect: update version comment

5 years agodetect: Fix typos/spelling errors.
Jeff Lucovsky [Sat, 21 Dec 2019 16:12:30 +0000 (11:12 -0500)] 
detect: Fix typos/spelling errors.

5 years agomain: feature init and release
Jeff Lucovsky [Fri, 20 Dec 2019 00:51:59 +0000 (19:51 -0500)] 
main: feature init and release

5 years agooutput/filestore: announce provided features
Jeff Lucovsky [Fri, 20 Dec 2019 00:51:08 +0000 (19:51 -0500)] 
output/filestore: announce provided features

5 years agodetect/filestore: Warn if req'd feature missing
Jeff Lucovsky [Fri, 20 Dec 2019 00:50:30 +0000 (19:50 -0500)] 
detect/filestore: Warn if req'd feature missing

5 years agodetect/analysis: Warn if required feature missing
Jeff Lucovsky [Fri, 20 Dec 2019 00:49:21 +0000 (19:49 -0500)] 
detect/analysis: Warn if required feature missing

5 years agofeature: feature tracking services
Jeff Lucovsky [Fri, 20 Dec 2019 00:48:25 +0000 (19:48 -0500)] 
feature: feature tracking services

5 years agoperf: optimizes alert fast log
Philippe Antoine [Fri, 6 Dec 2019 07:58:56 +0000 (08:58 +0100)] 
perf: optimizes alert fast log

In the case when we have multiple alerts for one packet
We suppose this happens more often than having decoder_event != 0

5 years agonapatech: add hardware based bypass support 4566/head
Phil Young [Mon, 6 Jan 2020 18:43:32 +0000 (13:43 -0500)] 
napatech: add hardware based bypass support

Napatech hardware bypass support enables Suricata to utilize
capabilities of Napatech SmartNICs to selectively bypass flow-based
traffic.

5 years agonapatech: documentation hardware based bypass support
Phil Young [Mon, 6 Jan 2020 18:42:05 +0000 (13:42 -0500)] 
napatech: documentation hardware based bypass support

Napatech hardware bypass support enables Suricata to utilize
capabilities of Napatech SmartNICs to selectively bypass flow-based
traffic.

5 years agodoxygen: update config from 1.8.4 to 1.8.17
Andreas Herz [Fri, 31 Jan 2020 09:19:36 +0000 (10:19 +0100)] 
doxygen: update config from 1.8.4 to 1.8.17

5 years agodetect/parse: move spaces skip up the stack
Philippe Antoine [Wed, 9 Oct 2019 14:59:13 +0000 (16:59 +0200)] 
detect/parse: move spaces skip up the stack

Switch to isspace() as well.

5 years agoparser: make rust probing parsers optional 4561/head
Philippe Antoine [Tue, 18 Feb 2020 08:35:47 +0000 (09:35 +0100)] 
parser: make rust probing parsers optional

5 years agodecode: Fix typos/spelling 4553/head
Jeff Lucovsky [Sat, 28 Dec 2019 14:45:31 +0000 (09:45 -0500)] 
decode: Fix typos/spelling

5 years agodecode: Handle ERSPAN Type I
Jeff Lucovsky [Sat, 28 Dec 2019 14:44:56 +0000 (09:44 -0500)] 
decode: Handle ERSPAN Type I

5 years agoconfigure: update to match autoscan suggestions 4550/head
Victor Julien [Fri, 14 Feb 2020 10:07:45 +0000 (11:07 +0100)] 
configure: update to match autoscan suggestions

5 years agoconfigure: clean up func checks
Victor Julien [Fri, 14 Feb 2020 09:17:22 +0000 (10:17 +0100)] 
configure: clean up func checks

5 years agoinit: move main to a separate file
Philippe Antoine [Wed, 22 Jan 2020 08:33:05 +0000 (09:33 +0100)] 
init: move main to a separate file

so as to reuse code from suricata.c with fuzz targets

5 years agofuzz: disable signal handlers while fuzzing
Philippe Antoine [Wed, 22 Jan 2020 08:30:51 +0000 (09:30 +0100)] 
fuzz: disable signal handlers while fuzzing

5 years agoinit: make PostConfLoadedSetup global
Philippe Antoine [Wed, 22 Jan 2020 08:30:26 +0000 (09:30 +0100)] 
init: make PostConfLoadedSetup global

to be used by fuzz targets

5 years agoinit: fix PostConfLoadedSetup to use local suri ptr
Philippe Antoine [Wed, 22 Jan 2020 08:28:36 +0000 (09:28 +0100)] 
init: fix PostConfLoadedSetup to use local suri ptr

5 years agoinit: InitGlobal function
Philippe Antoine [Thu, 16 Jan 2020 07:49:19 +0000 (08:49 +0100)] 
init: InitGlobal function

To be reused by fuzz targets

5 years agoutil: UTHmemsearch to use memmem if defined
Philippe Antoine [Thu, 24 Oct 2019 12:41:21 +0000 (14:41 +0200)] 
util: UTHmemsearch to use memmem if defined

5 years agocheck: Using const keyword for some arguments
Philippe Antoine [Fri, 12 Jul 2019 14:26:28 +0000 (16:26 +0200)] 
check: Using const keyword for some arguments

For ConfigSetLogDirectory and PrintRawLineHexBuf

5 years agolog: can use a file set from env variable
Philippe Antoine [Mon, 27 May 2019 15:00:05 +0000 (17:00 +0200)] 
log: can use a file set from env variable

Enables the redirection of log to a file set by an environment
variable SC_LOG_FILE when SC_LOG_OP_IFACE=file

5 years agostream/reassembly: fix data overlap check 4547/head
vanlink [Thu, 16 Jan 2020 08:27:57 +0000 (16:27 +0800)] 
stream/reassembly: fix data overlap check

Fix function CheckOverlap bug.

5 years agotls: fix missing extern logic for cert_id tracking 4537/head
Victor Julien [Wed, 29 Jan 2020 12:50:05 +0000 (13:50 +0100)] 
tls: fix missing extern logic for cert_id tracking

5 years agostats: fix missing extern keyword
Victor Julien [Wed, 29 Jan 2020 12:46:56 +0000 (13:46 +0100)] 
stats: fix missing extern keyword

5 years agodefrag: fix use of globals
Victor Julien [Wed, 29 Jan 2020 12:43:49 +0000 (13:43 +0100)] 
defrag: fix use of globals

5 years agothreading: fix queue handlers globals use
Victor Julien [Wed, 29 Jan 2020 12:30:35 +0000 (13:30 +0100)] 
threading: fix queue handlers globals use

5 years agohtp: fix globals use for flags
Victor Julien [Wed, 29 Jan 2020 12:28:17 +0000 (13:28 +0100)] 
htp: fix globals use for flags

5 years agoproto: fix globals use
Victor Julien [Wed, 29 Jan 2020 12:27:58 +0000 (13:27 +0100)] 
proto: fix globals use

5 years agoflow: fix global variable use
Victor Julien [Wed, 29 Jan 2020 12:23:36 +0000 (13:23 +0100)] 
flow: fix global variable use

5 years agostream: fix global declaration of the config
Victor Julien [Wed, 29 Jan 2020 10:55:27 +0000 (11:55 +0100)] 
stream: fix global declaration of the config

5 years agothreading/modules: fix global declarations
Victor Julien [Wed, 29 Jan 2020 10:51:11 +0000 (11:51 +0100)] 
threading/modules: fix global declarations

5 years agoippair: fix global declarations
Victor Julien [Wed, 29 Jan 2020 09:56:54 +0000 (10:56 +0100)] 
ippair: fix global declarations

5 years agohost: fix global declarations
Victor Julien [Wed, 29 Jan 2020 09:37:44 +0000 (10:37 +0100)] 
host: fix global declarations

5 years agompm: fix global declarations
Victor Julien [Wed, 29 Jan 2020 09:28:16 +0000 (10:28 +0100)] 
mpm: fix global declarations

5 years agodetect: fix global declaration of sigmatch_table
Victor Julien [Wed, 29 Jan 2020 09:22:57 +0000 (10:22 +0100)] 
detect: fix global declaration of sigmatch_table

5 years agospm: fix global declaration of spm_table
Victor Julien [Wed, 29 Jan 2020 09:11:54 +0000 (10:11 +0100)] 
spm: fix global declaration of spm_table

5 years agothreading: fix global declaration of threading_set_cpu_affinity
Victor Julien [Wed, 29 Jan 2020 07:33:18 +0000 (08:33 +0100)] 
threading: fix global declaration of threading_set_cpu_affinity

5 years agounix-socket: avoid using global variable w/o extern
Victor Julien [Wed, 29 Jan 2020 07:15:21 +0000 (08:15 +0100)] 
unix-socket: avoid using global variable w/o extern

5 years agodecode: fix default-packet-size global variable
Victor Julien [Wed, 29 Jan 2020 07:10:59 +0000 (08:10 +0100)] 
decode: fix default-packet-size global variable

5 years agonfs: implement post-GAP transaction cleanup
Victor Julien [Tue, 11 Feb 2020 10:55:18 +0000 (11:55 +0100)] 
nfs: implement post-GAP transaction cleanup

Close all prior transactions in the direction of the GAP, except the
file xfers. Those use their own logic described below.

After a GAP all normal transactions are closed. File transactions
are left open as they can handle GAPs in principle. However, the
GAP might have contained the closing of a file and therefore it
may remain active until the end of the flow.

This patch introduces a time based heuristic for these transactions.
After the GAP all file transactions are stamped with the current
timestamp. If 60 seconds later a file has seen no update, its marked
as closed.

This is meant to fix resource starvation issues observed in long
running SMB sessions where packet loss was causing GAPs. Due to the
similarity of the NFS and SMB parsers, this issue is fixed for NFS
as well in this patch.

Bug #3424.
Bug #3425.

5 years agodetect/file-data: remove debug abort that wasn't reachable 4536/head
Victor Julien [Tue, 26 Nov 2019 13:46:02 +0000 (14:46 +0100)] 
detect/file-data: remove debug abort that wasn't reachable

5 years agodetect/file-data: fix function doc
Victor Julien [Tue, 26 Nov 2019 13:45:34 +0000 (14:45 +0100)] 
detect/file-data: fix function doc

5 years agofiles: tracking flag update
Victor Julien [Tue, 26 Feb 2019 11:38:19 +0000 (12:38 +0100)] 
files: tracking flag update

Improve flow file flags and file flags updates. Introduce a mask
that is set at start up to avoid lots of runtime checks.

Disable cocci flags check as it doesn't support the more dynamic
nature of the flag updates.

5 years agoapp-layer/files: optimize GetFiles calls
Victor Julien [Tue, 26 Feb 2019 09:56:53 +0000 (10:56 +0100)] 
app-layer/files: optimize GetFiles calls

Remove FlowGetProtoMapping calls from the GetFiles wrapper and
get the alstate from the flow directly.

5 years agoapp-layer: all protocols are tx aware now
Victor Julien [Tue, 26 Feb 2019 09:42:24 +0000 (10:42 +0100)] 
app-layer: all protocols are tx aware now

So remove the runtime check for it.

5 years agoinit: Fix dropping privileges in nflog runmode 4531/head
Timo Sigurdsson [Mon, 3 Feb 2020 22:17:17 +0000 (23:17 +0100)] 
init: Fix dropping privileges in nflog runmode

Using the run-as configuration option with the nflog capture method
results in the following error during the startup of suricata:
[ERRCODE: SC_ERR_NFLOG_BIND(248)] - nflog_bind_pf() for AF_INET failed

This is because SCDropMainThreadCaps does not have any capabilities
defined for the nflog runmode (unlike other runmodes). Therefore, apply
the same capabilities to the nflog runmode that are already defined for
the nfqueue runmode. This has been confirmed to allow suricata start
and drop its privileges in the nflog runmode.

Fixes redmine issue #3265.

Signed-off-by: Timo Sigurdsson <public_timo.s@silentcreek.de>
5 years agodecode: remove pseudo packet checks
Victor Julien [Mon, 11 Nov 2019 10:59:35 +0000 (11:59 +0100)] 
decode: remove pseudo packet checks

Bug 1107 checks/hacks should not longer be needed, so remove them.

5 years agothreading/queues: simplify error handling
Victor Julien [Wed, 13 Nov 2019 18:50:48 +0000 (19:50 +0100)] 
threading/queues: simplify error handling

5 years agothreading/queues: remove 256 queue limit
Victor Julien [Wed, 13 Nov 2019 16:16:06 +0000 (17:16 +0100)] 
threading/queues: remove 256 queue limit

Convert fixed size array to a dynamic TAILQ so we can
grow as needed.

5 years agothreading: remove 'trans_q' array of packet queues
Victor Julien [Wed, 13 Nov 2019 15:29:11 +0000 (16:29 +0100)] 
threading: remove 'trans_q' array of packet queues

Let the queues code set up PacketQueues on demand.

5 years agopacket-queue: create alloc and free functions
Victor Julien [Wed, 13 Nov 2019 15:16:15 +0000 (16:16 +0100)] 
packet-queue: create alloc and free functions

5 years agothreading: hide 'trans_q' from queue handlers
Victor Julien [Wed, 13 Nov 2019 14:59:51 +0000 (15:59 +0100)] 
threading: hide 'trans_q' from queue handlers

5 years agothreading/threadvars: optimize layout
Victor Julien [Wed, 13 Nov 2019 10:39:44 +0000 (11:39 +0100)] 
threading/threadvars: optimize layout

Make sure StatsPublicThreadContext is on its own cache line.

5 years agoflowworker/stream: use no-lock packet queue
Victor Julien [Wed, 13 Nov 2019 08:43:11 +0000 (09:43 +0100)] 
flowworker/stream: use no-lock packet queue

Use smaller structure for temporary packet queues.

5 years agothreading: change local packet queue logic
Victor Julien [Tue, 12 Nov 2019 21:34:51 +0000 (22:34 +0100)] 
threading: change local packet queue logic

Previously each 'TmSlot' had it's own packet queue that was passed
to the registered SlotFunc as an argument. This was used mostly for
tunnel packets by the decoders and by defrag.

This patch removes that in favor of a single queue in the ThreadVars:
decode_pq. This is the non-locked version of the queue as this is
only a temporary store for handling packets within a thread.

This patch removes the PacketQueue pointer argument from the API.
The new queue can be accessed directly through the ThreadVars
pointer.

5 years agopacket-queue: introduce a non-locked version
Victor Julien [Tue, 12 Nov 2019 13:54:55 +0000 (14:54 +0100)] 
packet-queue: introduce a non-locked version

Works exactly like PacketQueue, just does not contain a mutex
and cond var, leading to much reduced memory size.

5 years agothreading: more efficient TmSlot layout
Victor Julien [Tue, 12 Nov 2019 13:54:33 +0000 (14:54 +0100)] 
threading: more efficient TmSlot layout

5 years agothreading: remove 'id' field from TmSlot
Victor Julien [Tue, 12 Nov 2019 12:28:09 +0000 (13:28 +0100)] 
threading: remove 'id' field from TmSlot

Field was now unused.

5 years agodetect: cleanup reload thread handling
Victor Julien [Tue, 12 Nov 2019 12:03:58 +0000 (13:03 +0100)] 
detect: cleanup reload thread handling

5 years agothreading: simplify flow timeout loop
Victor Julien [Tue, 12 Nov 2019 11:54:18 +0000 (12:54 +0100)] 
threading: simplify flow timeout loop

5 years agothreading: shrink and reorganize TmSlot
Victor Julien [Tue, 12 Nov 2019 11:44:57 +0000 (12:44 +0100)] 
threading: shrink and reorganize TmSlot

5 years agothreading/threadvars: rearrange for better cache behavior
Victor Julien [Tue, 12 Nov 2019 09:01:18 +0000 (10:01 +0100)] 
threading/threadvars: rearrange for better cache behavior

5 years agothreading/threadvars: remove unused 'prev' field
Victor Julien [Mon, 11 Nov 2019 19:57:35 +0000 (20:57 +0100)] 
threading/threadvars: remove unused 'prev' field

5 years agothreading: remove unused 'TmThreadRemove' function
Victor Julien [Mon, 11 Nov 2019 19:53:03 +0000 (20:53 +0100)] 
threading: remove unused 'TmThreadRemove' function

5 years agothreading: remove handler names to shink struct
Victor Julien [Mon, 11 Nov 2019 19:49:24 +0000 (20:49 +0100)] 
threading: remove handler names to shink struct

Shrink ThreadVars by removing the queue handler names that are only
used at shutdown. Since this is not performance critical, we can use
the id's to look up the queue handler.

5 years agothreading/queues: add way to lookup by ID
Victor Julien [Mon, 11 Nov 2019 19:48:11 +0000 (20:48 +0100)] 
threading/queues: add way to lookup by ID

In preparation of doing runtime operations by ID instead of by name,
add functions to look up by ID and to convert name to ID.

5 years agothreading: shrink threadvars struct size
Victor Julien [Mon, 11 Nov 2019 16:01:12 +0000 (17:01 +0100)] 
threading: shrink threadvars struct size

5 years agothreading: remove unused threadvars field
Victor Julien [Mon, 11 Nov 2019 15:52:47 +0000 (16:52 +0100)] 
threading: remove unused threadvars field

5 years agothreading: clarify threadvars fields
Victor Julien [Mon, 11 Nov 2019 15:49:55 +0000 (16:49 +0100)] 
threading: clarify threadvars fields

5 years agothreading: cleanup packet thread shutdown loop
Victor Julien [Mon, 11 Nov 2019 15:11:55 +0000 (16:11 +0100)] 
threading: cleanup packet thread shutdown loop

5 years agosource-pcap: remove unused function
Victor Julien [Mon, 11 Nov 2019 14:44:33 +0000 (15:44 +0100)] 
source-pcap: remove unused function

5 years agothreading/modules: declare prototypes static
Victor Julien [Mon, 11 Nov 2019 07:16:26 +0000 (08:16 +0100)] 
threading/modules: declare prototypes static

Declare registered threading API funcs static where appropriate.

5 years agosources: fix pipeline failure handling
Victor Julien [Mon, 11 Nov 2019 14:26:32 +0000 (15:26 +0100)] 
sources: fix pipeline failure handling

When TmThreadsSlotProcessPkt fails it will return the packet that was
passed to it to the packetpool.

Some of the packet sources were doing this manually as well. This patch
fixes those sources.

5 years agothreading: use tm_flowworker for pseudo packets
Victor Julien [Mon, 11 Nov 2019 10:19:44 +0000 (11:19 +0100)] 
threading: use tm_flowworker for pseudo packets

Pseudo packets don't need to be processed by the decoding layer.

5 years agothreading: add shortcut to flowworker
Victor Julien [Mon, 11 Nov 2019 10:11:55 +0000 (11:11 +0100)] 
threading: add shortcut to flowworker

5 years agothreading: remove per slot post_pq
Victor Julien [Sat, 9 Nov 2019 19:24:21 +0000 (20:24 +0100)] 
threading: remove per slot post_pq

Use a single packet queue per thread for flow timeout packet
injection. The per slot queue was unused except for this use
case. Having a single queue makes the logic and implementation
simpler.

In case of 'autofp', the per thread packet queue will actually
use the threads input queue. For workers/single a dedicated
queue will be set up.

Rename TmThreadsSlotHandlePostPQs to TmThreadsHandleInjectedPackets
to reflect the changed logic.

5 years agoaf-packet: prototypes cleanup
Victor Julien [Mon, 11 Nov 2019 07:07:35 +0000 (08:07 +0100)] 
af-packet: prototypes cleanup

Remove unused prototype.

Declare other prototypes static.

5 years agothreading: remove post_pq argument from 'SlotFunc'
Victor Julien [Mon, 11 Nov 2019 07:07:35 +0000 (08:07 +0100)] 
threading: remove post_pq argument from 'SlotFunc'

This was not in use anywhere.

5 years agorunmodes: code cleanups
Victor Julien [Mon, 4 Nov 2019 18:40:07 +0000 (19:40 +0100)] 
runmodes: code cleanups

5 years agodetect: clean up threads handling
Victor Julien [Mon, 4 Nov 2019 10:46:54 +0000 (11:46 +0100)] 
detect: clean up threads handling

Clean up reload and break loop thread handling.

5 years agodetect: inject packet cleanup
Victor Julien [Mon, 4 Nov 2019 10:20:40 +0000 (11:20 +0100)] 
detect: inject packet cleanup

5 years agoflow-manager: code cleanups
Victor Julien [Sun, 3 Nov 2019 19:43:56 +0000 (20:43 +0100)] 
flow-manager: code cleanups

5 years agoflow-manager: avoid doubly signaling threads
Victor Julien [Sun, 3 Nov 2019 19:42:47 +0000 (20:42 +0100)] 
flow-manager: avoid doubly signaling threads

Don't try to wake up the threads we just flagged and validated that
they changed their state.

5 years agothreading: remove commented out function
Victor Julien [Sun, 3 Nov 2019 19:13:33 +0000 (20:13 +0100)] 
threading: remove commented out function

5 years agothreading: optimize and unify post_pq checks
Victor Julien [Sun, 3 Nov 2019 15:02:21 +0000 (16:02 +0100)] 
threading: optimize and unify post_pq checks

TmThreadsSlotProcessPkt did not need to look all 'slots' as only the first
slots post_pq can have been used.

Unify post_pq cleanup handling.

5 years agothreading: remove wrong unlikely statement; minor cleanups
Victor Julien [Sun, 3 Nov 2019 14:57:23 +0000 (15:57 +0100)] 
threading: remove wrong unlikely statement; minor cleanups

5 years agothreading: TmSlot::SlotFunc does not need to be atomic
Victor Julien [Sun, 3 Nov 2019 14:47:01 +0000 (15:47 +0100)] 
threading: TmSlot::SlotFunc does not need to be atomic

5 years agothreading: fix flags handling by using uint32_t everywhere
Victor Julien [Sun, 3 Nov 2019 09:37:06 +0000 (10:37 +0100)] 
threading: fix flags handling by using uint32_t everywhere

5 years agothreading: optimize error handling in main packet loop
Victor Julien [Sun, 3 Nov 2019 09:02:18 +0000 (10:02 +0100)] 
threading: optimize error handling in main packet loop

5 years agothreading: minor code style cleanups
Victor Julien [Sun, 3 Nov 2019 09:00:14 +0000 (10:00 +0100)] 
threading: minor code style cleanups

5 years agothreading: simplify packetpool checks
Victor Julien [Sun, 3 Nov 2019 08:58:34 +0000 (09:58 +0100)] 
threading: simplify packetpool checks

5 years agothreading/queues: add shortcut for packetpool check
Victor Julien [Sun, 3 Nov 2019 08:52:21 +0000 (09:52 +0100)] 
threading/queues: add shortcut for packetpool check

Allows code simplifycation in the threading loops.

5 years agothreading/queues: minor code cleanups
Victor Julien [Sun, 3 Nov 2019 08:28:46 +0000 (09:28 +0100)] 
threading/queues: minor code cleanups