]> git.ipfire.org Git - thirdparty/suricata.git/log
thirdparty/suricata.git
6 years agochangelog: update for 4.0.6 3551/head suricata-4.0.6
Victor Julien [Tue, 6 Nov 2018 08:53:15 +0000 (09:53 +0100)] 
changelog: update for 4.0.6

6 years agosmtp/mime: fix null ptr deref on bad traffic
Victor Julien [Tue, 30 Oct 2018 15:10:33 +0000 (16:10 +0100)] 
smtp/mime: fix null ptr deref on bad traffic

Due to missing error handling, a bad mime message could put the
mime parser in an error state, without the SMTP layer taking this
into account. So the SMTP layer would continue to pass data to the
mime parser, even though it was in an error state.

When the parser would be fed a very long line while in this state,
it would try to set an error flag in the state. However, due to
the error state, this setting of the flag would dereference a null
pointer.

This patch fixes this issue by updating the mime parser to check
the state it is in when receiving new input. It will refuse to
process futher data while in the error state. It will also return
a new error code to indicate to the SMTP layer that the parser
was in an error state.

6 years agoaf-packet: improve error handling
Eric Leblond [Mon, 8 Oct 2018 21:51:37 +0000 (23:51 +0200)] 
af-packet: improve error handling

Stress condition in Suricata could lead to interface to disconnect
when it is not necessary. This patch updates the error handling
code to try to continue reading when such a case occurs.

6 years agostorage: don't leak memory for unittests 3538/head
Victor Julien [Fri, 26 Oct 2018 14:03:05 +0000 (16:03 +0200)] 
storage: don't leak memory for unittests

6 years agoradix: fix a memleak when removing the last node
Victor Julien [Fri, 26 Oct 2018 14:15:58 +0000 (16:15 +0200)] 
radix: fix a memleak when removing the last node

6 years agodetect/address: minor memory handling cleanups
Victor Julien [Thu, 25 Oct 2018 15:31:49 +0000 (17:31 +0200)] 
detect/address: minor memory handling cleanups

6 years agodetect: suppress scan-build warnings
Victor Julien [Thu, 25 Oct 2018 15:02:43 +0000 (17:02 +0200)] 
detect: suppress scan-build warnings

6 years agodetect/flags: cleanup parsing to not alloc temp strings
Victor Julien [Thu, 25 Oct 2018 10:30:12 +0000 (12:30 +0200)] 
detect/flags: cleanup parsing to not alloc temp strings

6 years agompm: fix minor scan-build warning
Victor Julien [Thu, 25 Oct 2018 09:55:05 +0000 (11:55 +0200)] 
mpm: fix minor scan-build warning

6 years agopool: avoid possible double free in error path
Victor Julien [Thu, 25 Oct 2018 09:44:53 +0000 (11:44 +0200)] 
pool: avoid possible double free in error path

Should be impossible as a double free, but scan-build-7 thinks it
is possible.

6 years agopool: small code cleanups
Victor Julien [Thu, 25 Oct 2018 09:44:15 +0000 (11:44 +0200)] 
pool: small code cleanups

6 years agostream: don't assume malformed TCP packets
Victor Julien [Thu, 25 Oct 2018 06:27:22 +0000 (08:27 +0200)] 
stream: don't assume malformed TCP packets

This deep in the stream engine packets are valid, so don't check
for the tcph header in a packet as it confuses scan-build.

Do add a DEBUG_VALIDATE_BUG_ON so in QA we double check.

6 years agodecode/tcp: rewrite options decoding to assist scan-build
Victor Julien [Wed, 24 Oct 2018 09:05:21 +0000 (11:05 +0200)] 
decode/tcp: rewrite options decoding to assist scan-build

6 years agosmb/c: don't accept null input
Victor Julien [Wed, 24 Oct 2018 08:58:58 +0000 (10:58 +0200)] 
smb/c: don't accept null input

6 years agohtp: fix potential (but unlikely) memleak in uri normalization
Victor Julien [Tue, 23 Oct 2018 14:17:26 +0000 (16:17 +0200)] 
htp: fix potential (but unlikely) memleak in uri normalization

6 years agothresholds: remove dead code in parsing
Victor Julien [Tue, 23 Oct 2018 13:10:56 +0000 (15:10 +0200)] 
thresholds: remove dead code in parsing

6 years agoradix: fix memory leak in error path
Victor Julien [Tue, 23 Oct 2018 13:08:05 +0000 (15:08 +0200)] 
radix: fix memory leak in error path

6 years agocoverity: suppress warnings
Victor Julien [Tue, 23 Oct 2018 13:01:42 +0000 (15:01 +0200)] 
coverity: suppress warnings

6 years agohost/os/info: fix lookup memleak
Victor Julien [Tue, 23 Oct 2018 12:59:15 +0000 (14:59 +0200)] 
host/os/info: fix lookup memleak

6 years agodebug/log: suppress coverity checked_return warning
Victor Julien [Tue, 23 Oct 2018 12:54:17 +0000 (14:54 +0200)] 
debug/log: suppress coverity checked_return warning

6 years agobpf: suppress coverity toctou warning
Victor Julien [Tue, 23 Oct 2018 12:53:28 +0000 (14:53 +0200)] 
bpf: suppress coverity toctou warning

6 years agopcap: fix buffer size validation logic
Victor Julien [Tue, 23 Oct 2018 12:51:25 +0000 (14:51 +0200)] 
pcap: fix buffer size validation logic

6 years agouricontent: move debug func into unittests
Victor Julien [Tue, 23 Oct 2018 12:43:35 +0000 (14:43 +0200)] 
uricontent: move debug func into unittests

Cleanup header, which lead to the app-layer-htp.h header needing to
be added in a few other places.

6 years agodetect/replace: fix mem leak in error path
Victor Julien [Tue, 23 Oct 2018 12:37:05 +0000 (14:37 +0200)] 
detect/replace: fix mem leak in error path

6 years agoisdataat: fix mem leak in error path
Victor Julien [Tue, 23 Oct 2018 12:34:08 +0000 (14:34 +0200)] 
isdataat: fix mem leak in error path

6 years agobits: avoid memory leak in case of adding types
Victor Julien [Tue, 23 Oct 2018 12:29:59 +0000 (14:29 +0200)] 
bits: avoid memory leak in case of adding types

6 years agoipproto: fix memleak in error case
Victor Julien [Tue, 23 Oct 2018 12:10:18 +0000 (14:10 +0200)] 
ipproto: fix memleak in error case

6 years agobytetest: don't leak memory in error condition
Victor Julien [Tue, 23 Oct 2018 11:56:50 +0000 (13:56 +0200)] 
bytetest: don't leak memory in error condition

6 years agoyaml: fix potential memleak and suppress coverity issue
Victor Julien [Tue, 23 Oct 2018 11:53:13 +0000 (13:53 +0200)] 
yaml: fix potential memleak and suppress coverity issue

6 years agooutputs: fix memleaks in the error paths reported by coverity
Victor Julien [Tue, 23 Oct 2018 11:49:37 +0000 (13:49 +0200)] 
outputs: fix memleaks in the error paths reported by coverity

6 years agocoverity: suppress warning for intentional code
Victor Julien [Tue, 23 Oct 2018 11:23:09 +0000 (13:23 +0200)] 
coverity: suppress warning for intentional code

6 years agorust/dns: don't compile unused C code if Rust is enabled
Victor Julien [Tue, 23 Oct 2018 11:21:08 +0000 (13:21 +0200)] 
rust/dns: don't compile unused C code if Rust is enabled

6 years agocoverity: don't warn on fall back random
Victor Julien [Tue, 23 Oct 2018 10:57:50 +0000 (12:57 +0200)] 
coverity: don't warn on fall back random

6 years agohttp: implement min size stream logic
Victor Julien [Fri, 17 Aug 2018 15:53:16 +0000 (17:53 +0200)] 
http: implement min size stream logic

Update HTTP parser to set the min inspect depth per transaction. This
allows for signatures to have their fast_pattern in the HTTP body,
while still being able to inspect the raw stream reliably with it.

The inspect depth is set per transaction as it:
- depends on the per personality config for min inspect size
- is set to the size of the actual body if it is smaller

After the initial inspection is done, it is set to 0 which disables
the feature for the rest of the transaction.

This removes the rescanning flush logic in commit
7e004f52c60c5e4d7cd8f5ed09491291d18f42d2 and provides an alternative
fix for bug #2522. The old approach caused too much rescanning of
HTTP body data leading to a performance degradation.

Bug #2522

6 years agostream: introduce min inspect depth logic
Victor Julien [Fri, 17 Aug 2018 08:41:51 +0000 (10:41 +0200)] 
stream: introduce min inspect depth logic

Some rules need to inspect both raw stream data and higher level
buffers together. When this higher level buffer is a streaming
buffer itself, the risk of mismatch exists.

This patch allows an app-layer parser to set a 'min inspect depth'.
The value is used by the stream engine to keep at least this
depth worth of data, so that the detection engine can request
all of it for inspection.

For rules that have the SIG_FLAG_FLUSH flag set, data is inspected
not from offset raw_progress, but from raw_progress minus
min_inspect_depth.

At this time this is only used for sigs that have their fast_pattern
in a HTTP body and have raw stream match as well.

6 years agogcc8: fix format truncation warnings
Victor Julien [Tue, 24 Apr 2018 10:01:40 +0000 (12:01 +0200)] 
gcc8: fix format truncation warnings

6 years agostream/tcp: be more liberal in last_ack
Victor Julien [Sun, 2 Sep 2018 09:34:42 +0000 (11:34 +0200)] 
stream/tcp: be more liberal in last_ack

Don't set even if seq is before next_seq, as this could still be
a valid packet that was sent before the state was reached.

6 years agostream/tcp: add debug statements to state dispatcher
Victor Julien [Sun, 2 Sep 2018 09:34:22 +0000 (11:34 +0200)] 
stream/tcp: add debug statements to state dispatcher

6 years agounittests: fix format-truncation warning
Victor Julien [Thu, 13 Sep 2018 10:18:32 +0000 (12:18 +0200)] 
unittests: fix format-truncation warning

6 years agoflow/timeout: code simplification and cleanup
Victor Julien [Wed, 29 Aug 2018 19:14:28 +0000 (21:14 +0200)] 
flow/timeout: code simplification and cleanup

6 years agoflow-manager: fix unittest initialization
Victor Julien [Sun, 26 Aug 2018 06:56:33 +0000 (08:56 +0200)] 
flow-manager: fix unittest initialization

6 years agoaf-packet: close the socket in case of early fail
Eric Leblond [Tue, 28 Aug 2018 20:46:25 +0000 (22:46 +0200)] 
af-packet: close the socket in case of early fail

6 years agolog-filestore: fix file descriptor leak
Eric Leblond [Wed, 22 Aug 2018 22:21:51 +0000 (00:21 +0200)] 
log-filestore: fix file descriptor leak

In the case we exceed the number of simultaneously open
file we can reach a state were we will not close the file
after writing.

Thanks to Steve Grubb <sgrubb@redhat.com> for the analysis.

6 years agodetect/prefilter: speed up setup
Victor Julien [Thu, 9 Aug 2018 22:06:24 +0000 (00:06 +0200)] 
detect/prefilter: speed up setup

If the global detect.prefilter.default setting is not "auto", it is
wasteful to run each prefilter setup routine. This patch tracks which
of the engines have been explicitly enabled in the rules and only
runs those.

6 years agodetect/prefilter: fix prefilter when setting is 'mpm'
Victor Julien [Thu, 9 Aug 2018 15:35:32 +0000 (17:35 +0200)] 
detect/prefilter: fix prefilter when setting is 'mpm'

When prefilter is not enabled globally, it is still possible to
enable it per signature. This was broken however, as the setup
code would never be called.

This commit always call the setup code and lets that sort out
which signatures (if any) to enable prefiltering for.

6 years agodetect: limit flush logic to sigs that need it
Victor Julien [Thu, 9 Aug 2018 13:32:49 +0000 (15:32 +0200)] 
detect: limit flush logic to sigs that need it

Limit the early 'flush' logic to sigs that actually need to match
on both stream and http bodies.

6 years agodetect/prefilter: fix alias for fast_pattern
Victor Julien [Thu, 9 Aug 2018 15:33:19 +0000 (17:33 +0200)] 
detect/prefilter: fix alias for fast_pattern

If prefilter is used on a content keyword, it acts as a simple
fast_pattern statement. This was broken because the SIG_FLAG_PREFILTER
flag bypasses MPM for a sig. This commits fixes this by not setting
the flag when it should act as fast_pattern.

6 years agodetect/http: flush bodies when inspecting stream
Victor Julien [Wed, 8 Aug 2018 12:06:43 +0000 (14:06 +0200)] 
detect/http: flush bodies when inspecting stream

The HTTP bodies (http_client_body and http_server_body/file_data) use
settings to control how much data we have before doing first inspection:

    request-body-minimal-inspect-size
    response-body-minimal-inspect-size

These settings default to 32k as quite some existing rules need this.

At the same time, the 'raw stream' inspection uses its own limits. By
default it inspects the data in blocks of about 2.5k. This could lead
to a situation where rules would not match.

For example, with 2 rules like this:

    content:"abc"; content:"data="; http_client_body; depth:5; sid:1;
    content:"xyz"; sid:2;

Sid 1 would only be inspected when the POST body reached the 32k limit
or when it was complete. Observed case shows the POST body to be 18k.
Sid 2 is inspected as soon as the 2.5k limit is reached, and then again
for each 2.5k increment. This moves the raw stream tracker forward.

So by the time sid 1 is inspected, some 18/19k into the stream, the
raw stream tracker is actually already moved forward for approximately
17.5k, this leads to the stream match of sid 1 possibly not matching.
Since the body match is at the start of the buffer, it makes sense
that the body and stream are inspected together.

The body inspection uses a tracker 'body_inspected', that keeps track
of how far into the body both MPM and per signature inspection has
moved.

This patch updates the logic in 2 ways:

1. it triggers earlier HTTP body inspection, which is matched to the
   stream inspection. When the detection engine finds it has stream
   data available for inspection, it passes the new 'STREAM_FLUSH'
   flag to the HTTP body inspection code. Which will then do an
   early inspection, even if still before the min inspect size.

2. to still somewhat adhere to the min inspect size, the body
   tracker is not updated until the min inspect size is reached.
   This will lead to some re-evaluation of the same body data.

If raw stream reassembly is disabled, this 'STREAM_FLUSH' flag is
never set, and the old behavior is used.

Bug #2522.

6 years agostream: improve TCP CLOSED handling
Victor Julien [Mon, 30 Jul 2018 08:26:21 +0000 (10:26 +0200)] 
stream: improve TCP CLOSED handling

Trigger app layer reassembly in both directions as soon as we've set
the TCP state to closed.

In IDS mode, if a toserver packet would close the state, the app layer
would not get updated until the next toclient packet. However, in
detection, the raw stream inspection would already use all available
stream data in detection and move the 'raw stream progress' tracker
forward. When in later (a) packet(s) the app layer was updated and
inspection ran on the app layer, the stream progress was already
moved too far forward. This would lead to signatures that matched
on both stream and app layer to not match.

By triggering the app layer reassembly as soon as the TCP state is
set to closed, the inspection as both the stream and app layer data
available at the same time so these rules can match.

Bug: #2570
Bug: #2554

6 years agodetect/files: don't prune files for bad packets
Victor Julien [Tue, 14 Aug 2018 12:33:20 +0000 (14:33 +0200)] 
detect/files: don't prune files for bad packets

A bad packet (rejected by stream engine) could still trigger a file
prune, even though (most of the) detection wouldn't happen for the
packet. The next valid packet would then not be able to match on the
file, as it was already freed.

This patch uses the same logic before file pruning as in the detect
engine.

Bug: 2576

6 years agodetect/filehash: try to open data file from rulefile dir
Victor Julien [Tue, 14 Aug 2018 08:17:37 +0000 (10:17 +0200)] 
detect/filehash: try to open data file from rulefile dir

If the data file can't be found in the default location, which
normally is 'default-rule-path', try to see if it can be found
in the path of the rule file that references it.

This makes QA much easier.

6 years agoflow: flag packets as established for async
Victor Julien [Tue, 7 Aug 2018 11:28:55 +0000 (13:28 +0200)] 
flow: flag packets as established for async

If a stream is async we see only on side of the traffic. This would
lead to the flow engine not flagging packets as 'established' even
if the flow state was in fact established. The flow was tagged as
such by the TCP engine.

This patch considers the flow state for setting the packet flag.

Bug #2491.

6 years agoenip: support gaps
Victor Julien [Tue, 21 Nov 2017 09:31:58 +0000 (10:31 +0100)] 
enip: support gaps

Due to a bug in the GAP handling the TCP layer the parser would already
get data after GAPs before.

6 years agostream: improve overlap detection
Victor Julien [Fri, 26 Jan 2018 08:14:16 +0000 (09:14 +0100)] 
stream: improve overlap detection

Improve detection of overlapping different data. Keep some data around
even if it was already ACK'd to check if packets have overlap.

6 years agostream-tcp: fix stream depth computation
Eric Leblond [Fri, 20 Apr 2018 17:23:21 +0000 (19:23 +0200)] 
stream-tcp: fix stream depth computation

The stream depth computation was partly done with the stream_config
depth instead of using the value in the TCP session. As a result,
some configuration were resulting in abnormal behavior.

In particular, when stream depth was 0 and the file store depth was
not 0, Suricata was stopping the streaming on the flow as soon as
the filestore was started.

Reported-by: Pascal Delalande <pdl35@free.fr>
6 years agostream: expand GAP detection
Victor Julien [Thu, 30 Aug 2018 13:03:34 +0000 (15:03 +0200)] 
stream: expand GAP detection

7 years agostream/app-layer: fix GAP handling issue
Victor Julien [Fri, 10 Nov 2017 22:03:16 +0000 (23:03 +0100)] 
stream/app-layer: fix GAP handling issue

Fix case where data after GAP was processed as in order data by app-layer.
This happened even if protocol parser did not register to accept GAPs.

7 years agodetect: fix fileext and filename negated match
Maurizio Abba [Tue, 31 Jul 2018 06:08:10 +0000 (07:08 +0100)] 
detect: fix fileext and filename negated match

fix bug in fileext and filename preventing negated match to work
correctly. Previously, negated fileext (such as !"php") would cause a
match anyway on files that have extension php, as the last if would not
be accessed.

Using the same workflow as detect-filemagic we remove the final
isolated if and set it as a branch of the previous if.

7 years agodcerpc: fix dce_iface not matching
Victor Julien [Wed, 1 Aug 2018 19:52:16 +0000 (21:52 +0200)] 
dcerpc: fix dce_iface not matching

7 years agochanglog: update for 4.0.5 3472/head suricata-4.0.5
Victor Julien [Mon, 16 Jul 2018 14:31:37 +0000 (16:31 +0200)] 
changlog: update for 4.0.5

7 years agompm/hs: fix minor coverity warning
Victor Julien [Tue, 3 Apr 2018 10:10:46 +0000 (12:10 +0200)] 
mpm/hs: fix minor coverity warning

CID 1428797 (#1 of 1): Unchecked return value (CHECKED_RETURN)
    check_return: Calling HashTableAdd without checking return value
    (as is done elsewhere 5 out of 6 times).

7 years agoenip: harden byte parsing code
Victor Julien [Thu, 19 Apr 2018 12:55:01 +0000 (14:55 +0200)] 
enip: harden byte parsing code

Make sure we never read more than we have.

Reported-by: Henning Perl
7 years agossh: fix out of bounds read in banner parsing
Victor Julien [Thu, 19 Apr 2018 09:27:43 +0000 (11:27 +0200)] 
ssh: fix out of bounds read in banner parsing

Reported-by: Henning Perl
7 years agorust/dns - remove extra parantheses
Jason Ish [Mon, 25 Jun 2018 14:40:54 +0000 (08:40 -0600)] 
rust/dns - remove extra parantheses

Removes rust compiler warning.

Redmine issue:
https://redmine.openinfosecfoundation.org/issues/2521

7 years agodetect/debug: suppress noisy info messages
Victor Julien [Thu, 28 Jun 2018 08:43:25 +0000 (10:43 +0200)] 
detect/debug: suppress noisy info messages

7 years agoyaml-loader: fix memory leak on fail include
Jason Ish [Mon, 25 Jun 2018 13:08:38 +0000 (07:08 -0600)] 
yaml-loader: fix memory leak on fail include

Redmine issue:
https://redmine.openinfosecfoundation.org/issues/1929

If an include failed to load, either by the file not existing or
a parse error, the file pointer and yaml parser instance were
leaked.

7 years agodetect: fix memory leak in app-layer-event keyword
Victor Julien [Wed, 4 Jul 2018 13:10:34 +0000 (15:10 +0200)] 
detect: fix memory leak in app-layer-event keyword

Bug #2515.

7 years agohttp: fix setting event on the last tx
Victor Julien [Thu, 5 Jul 2018 09:43:41 +0000 (11:43 +0200)] 
http: fix setting event on the last tx

7 years agohttp: set events for too many layers of compression
Victor Julien [Thu, 5 Jul 2018 08:01:47 +0000 (10:01 +0200)] 
http: set events for too many layers of compression

libhtp would already issue warnings, but these were not mapped
to events yet.

7 years agostream: support RST getting lost/ignored
Victor Julien [Thu, 10 May 2018 15:23:05 +0000 (17:23 +0200)] 
stream: support RST getting lost/ignored

In case of a valid RST on a SYN, the state is switched to 'TCP_CLOSED'.
However, the target of the RST may not have received it, or may not
have accepted it. Also, the RST may have been injected, so the supposed
sender may not actually be aware of the RST that was sent in it's name.

In this case the previous behavior was to switch the state to CLOSED and
accept no further TCP updates or stream reassembly.

This patch changes this. It still switches the state to CLOSED, as this
is by far the most likely to be correct. However, it will reconsider
the state if the receiver continues to talk.

To do this on each state change the previous state will be recorded in
TcpSession::pstate. If a non-RST packet is received after a RST, this
TcpSession::pstate is used to try to continue the conversation.

If the (supposed) sender of the RST is also continueing the conversation
as normal, it's highly likely it didn't send the RST. In this case
a stream event is generated.

Ticket: #2501

Reported-By: Kirill Shipulin
7 years agostream-events: fix mapping
Victor Julien [Mon, 21 May 2018 14:15:39 +0000 (16:15 +0200)] 
stream-events: fix mapping

7 years agodetect/stream_size: code cleanups
Victor Julien [Thu, 24 May 2018 12:56:03 +0000 (14:56 +0200)] 
detect/stream_size: code cleanups

7 years agodetect/stream_size: apply rule to packets & stream
Victor Julien [Wed, 23 May 2018 11:55:30 +0000 (13:55 +0200)] 
detect/stream_size: apply rule to packets & stream

The use of stream_size in combination with raw content matches is an
indication that the rule needs to be evaluated per packet, not just
per reassembled stream chunk.

7 years agoutil-random: fix detection of getrandom failure
Eric Leblond [Thu, 24 May 2018 11:43:30 +0000 (13:43 +0200)] 
util-random: fix detection of getrandom failure

7 years agoutil-random: workaround getrandom unavailability
Eric Leblond [Wed, 23 May 2018 06:57:13 +0000 (08:57 +0200)] 
util-random: workaround getrandom unavailability

getrandom syscall availability is detected at runtime. So it is
possible that the build is done on a box that supports it but
the run is done on a system with no availability. So a workaround
solution is needed to fix this case.

Also we have seen some issue in docker environment where the build
is detecting getrandom but where it does not work at runtime.

For both reasons, the code is updated to have a call to a fallback
function if ever the getrandom call returns that the syscall is
not available.

7 years agoFix segfault when the protocol is anything other than HTTP
Elazar Broad [Wed, 2 May 2018 16:38:40 +0000 (12:38 -0400)] 
Fix segfault when the protocol is anything other than HTTP

When a file is transferred over anything other than HTTP, the previously hard-coded HTTP protocol would trigger a non-existent index into htp_list_array_get(), causing a segfault. This patch mimics the logic in detect-lua-extensions.c.

7 years agoUpdate ntp-parser to 0.2.0
Pierre Chifflier [Tue, 15 May 2018 13:33:30 +0000 (15:33 +0200)] 
Update ntp-parser to 0.2.0

7 years agoutil-ioctl: fix a typo in setter message
Eric Leblond [Thu, 19 Apr 2018 14:58:27 +0000 (16:58 +0200)] 
util-ioctl: fix a typo in setter message

7 years agoaf-packet: dump counters when timeout occurs
Eric Leblond [Thu, 19 Apr 2018 17:13:20 +0000 (19:13 +0200)] 
af-packet: dump counters when timeout occurs

When traffic is becoming null (mainly seen in tests) we reach the
situation where there is timeouts in the poll on the socket and
only that. Existing code is then just looping on the poll and
the result is that the packet iface counters are not updated.

This patch calls the dump counter function to be sure to get
the counter right faster (and not only right at exit).

7 years agohyperscan: don't abort on payloads > 64k
Victor Julien [Wed, 25 Apr 2018 15:23:45 +0000 (17:23 +0200)] 
hyperscan: don't abort on payloads > 64k

SPM API was recently updated to accept 32 bit length fields instead of
16 bits. This could trigger a BUG_ON in the hyperscan implementation.

7 years agodetect: fix buffer length to uint32
Maurizio Abba [Tue, 10 Apr 2018 14:37:41 +0000 (15:37 +0100)] 
detect: fix buffer length to uint32

There is a difference in the size of the buffer length as passed from
the content buffers (cfr HttpReassembledBody.buffer_len) and the buflen
variable passed to mpm primitives. This can cause a misdetection
whenever the bufferlen is multiple of 65536 (as uint16(X*65536) == 0).
Increasing the buflen variable type to uint32 solves the issue (this
does not cause any issue with primitives, they all accept uint32).

7 years agompm/ac-ks: coding style fixes
Victor Julien [Mon, 6 Nov 2017 13:29:15 +0000 (14:29 +0100)] 
mpm/ac-ks: coding style fixes

7 years agounified2: address strict aliasing issue
Victor Julien [Wed, 4 Apr 2018 11:49:35 +0000 (13:49 +0200)] 
unified2: address strict aliasing issue

7 years agodecode/ipv6: expose addr as 'struct in6_addr' as well
Victor Julien [Wed, 4 Apr 2018 11:28:29 +0000 (13:28 +0200)] 
decode/ipv6: expose addr as 'struct in6_addr' as well

7 years agoconfigure: fix small issue with libevent check
Victor Julien [Tue, 3 Apr 2018 10:06:37 +0000 (12:06 +0200)] 
configure: fix small issue with libevent check

7 years agoBug #2466: map SC_LOG_CONFIG level to syslogs LOG_DEBUG
Alexander Gozman [Mon, 26 Mar 2018 14:14:48 +0000 (14:14 +0000)] 
Bug #2466: map SC_LOG_CONFIG level to syslogs LOG_DEBUG

7 years agoPrint syslog format with SCLogDebug() instead of printf()
Alexander Gozman [Thu, 29 Mar 2018 15:55:52 +0000 (15:55 +0000)] 
Print syslog format with SCLogDebug() instead of printf()

7 years agodoc: add by_either to suppress explanation
Victor Julien [Thu, 29 Mar 2018 13:31:47 +0000 (15:31 +0200)] 
doc: add by_either to suppress explanation

7 years agodoc: minor fix
Victor Julien [Thu, 29 Mar 2018 13:13:18 +0000 (15:13 +0200)] 
doc: minor fix

7 years agoconfigure: allow to disable libnss and libnspr
Renato Botelho [Thu, 22 Mar 2018 14:02:42 +0000 (11:02 -0300)] 
configure: allow to disable libnss and libnspr

Let user chose to disable libnss and libnspr support even if these
libraries are installed in the system. Default remains to enable when
libraries are found and disable parameter were not used

7 years agonfs/rpc: fix reponse parsing
Victor Julien [Wed, 21 Mar 2018 14:50:11 +0000 (15:50 +0100)] 
nfs/rpc: fix reponse parsing

7 years agowirefuzz: add 'quiet' mode 3373/head
Victor Julien [Wed, 2 May 2018 07:00:35 +0000 (09:00 +0200)] 
wirefuzz: add 'quiet' mode

Adds -q commandline option to force quiet operation.

7 years agohtp: cleanup and fix test
Victor Julien [Mon, 23 Apr 2018 10:33:02 +0000 (12:33 +0200)] 
htp: cleanup and fix test

7 years agohttp: add tests for header folding
Victor Julien [Thu, 19 Apr 2018 14:31:43 +0000 (16:31 +0200)] 
http: add tests for header folding

To test for https://github.com/OISF/libhtp/issues/159

7 years agohttp: clean up unittest
Victor Julien [Thu, 19 Apr 2018 13:34:51 +0000 (15:34 +0200)] 
http: clean up unittest

7 years agopcap-log: don't divide by 0 on no traffic
Victor Julien [Mon, 7 May 2018 14:20:45 +0000 (16:20 +0200)] 
pcap-log: don't divide by 0 on no traffic

7 years agooutput: fix logging wrong direction in tls upgrade 3353/head
Victor Julien [Fri, 2 Mar 2018 12:44:43 +0000 (13:44 +0100)] 
output: fix logging wrong direction in tls upgrade

When upgrading to TLS from HTTP logging of the final HTTP tx could
have the wrong direction. This was due to the original packet triggering/
finalizing the upgrade would be used as the base for both the toserver
and toclient pseudo packet meaning it was wrong in one direction.

This patch creates a pseudo packet in the same way as the flow timeout
code does, so it no longer takes the raw original packet in.

Bug #2430

7 years agochangelog: update for 4.0.4 suricata-4.0.4
Victor Julien [Tue, 13 Feb 2018 14:05:56 +0000 (15:05 +0100)] 
changelog: update for 4.0.4

7 years agorust/nfs: fix memory leak
Victor Julien [Tue, 13 Feb 2018 13:04:04 +0000 (14:04 +0100)] 
rust/nfs: fix memory leak

7 years agoautogen/rust: remove Cargo.lock
Victor Julien [Tue, 30 Jan 2018 11:20:42 +0000 (12:20 +0100)] 
autogen/rust: remove Cargo.lock

Remove Cargo.lock to avoid issues when updating Cargo.toml