Commit Graph

10657 Commits (46d2fc93a2c388463cb5b4768d19df40e0098aa6)
 

Author SHA1 Message Date
Victor Julien 46d2fc93a2 datasets: add 'dataset-remove' unix command
(cherry picked from commit 7a6269798b)
6 years ago
Victor Julien 3b8d828556 datasets: add 'remove' support
(cherry picked from commit af06883f65)
6 years ago
Victor Julien fdf4033220 datasets: silence noisy 'dataset-add' log
(cherry picked from commit 03dc5d1d74)
6 years ago
Victor Julien cc98e150f4 datasets: fix return values for 'add's
(cherry picked from commit ff55a444d4)
6 years ago
Victor Julien b706325933 datasets: fix ref cnt handling
Each 'add' and 'lookup' would increment the use_cnt, without anything
bringing it back down.

Since there is no removal yet, nothing is actually affected by it yet.

(cherry picked from commit 381bc2dd64)
6 years ago
Victor Julien e1202103c4 thash: add 'remove' support
(cherry picked from commit 51726e0a0f)
6 years ago
Victor Julien 9b5352edee datasets: improve 'dataset-add' error checking
(cherry picked from commit b80ab56d10)
6 years ago
Victor Julien b178286507 conf/datadir: fix possible out of bounds array access
(cherry picked from commit 0ce489bcc9)
6 years ago
Philippe Antoine dfd825a8cc detect: fix insertion in linked list for fast pattern
Make sure we do not add the same list_id twice
by checking at least all the lists with the current priority

(cherry picked from commit a0823bc6ec)
6 years ago
Jeff Lucovsky e718ec674f detect/lua: Unregister Lua object on free
This commit ensures that the LUA object is unregistered when the Lua
object is freed.
6 years ago
Jeff Lucovsky 240c6d9f9a detect: Provide function to clear per-thread ctx
This commit provides an interface to free previously allocated
per-thread contextual information on the keyword lists.

(cherry picked from commit d1151f3f8e)
6 years ago
Philippe Antoine 6b23ccc3aa ftp: indent FTPParseResponse again
(cherry picked from commit 699d6682da)
6 years ago
Philippe Antoine 9852fe80e4 ftp: use switch for ftp commands for style
(cherry picked from commit fef124b92d)
6 years ago
Philippe Antoine b557972fb6 ftp: FTPGetAlstateProgress for done port commands
For a done transaction with command PORT,
we expect FTP_STATE_FINISHED
and we got FTP_STATE_PORT_DONE instead
which prevented logging of these transactions

We change the order of the evaluations to get the right result

(cherry picked from commit 6f36403219)
6 years ago
Philippe Antoine 75c7b3e0c2 ftp: FTPParseResponse bufferizes lines
Protects against evasion by TCP packet splitting

The problem arised if the FTP response is split on multiple packets

The fix is to bufferize the content, until we get a complete line

(cherry picked from commit a6294d6ec2)
6 years ago
Philippe Antoine 8e2036314c conf: returns instead of exiting in ConfYamlParse
So that we can keep on fuzzing even on too much recursion

(cherry picked from commit fe1d36ec7e)
6 years ago
Philippe Antoine 8026390672 kerberos: fix against packet split in record size
(cherry picked from commit 23f796a021)
6 years ago
Victor Julien 3c0735495f detect/parse: properly free bidir sigs in error path
(cherry picked from commit fc6ada8541)
6 years ago
Victor Julien a33ed5b5f0 detect/parse: fix minor memory leak in error path
Only reachable on SCMalloc so should be unlikely to be reached.

(cherry picked from commit 5abead9325)
6 years ago
Victor Julien f1201453aa detect/iponly: fix parsing of '0' valued netmask
(cherry picked from commit 4d50eb1647)
6 years ago
Jason Ish 7a652f2986 conf/yaml: limit recursion depth while paring YAML
A deeply nested YAML file can cause a stack-overflow while
reading in the configuration to do the recursive parser. Limit
the recursion level to something sane (128) to prevent this
from happening.

The default Suricata configuration has a recursion level of 128
so there is still lots of room to grow (not that we should).

Redmine ticket:
https://redmine.openinfosecfoundation.org/issues/3630

(cherry picked from commit 4dc80a6e6f)
6 years ago
Victor Julien a2ebab10e2 nfs: fix buffering code using wrong dir 6 years ago
Jeff Lucovsky 6c763e23db detect/tls: Use pcre_copy_substring to avoid leak
This commit eliminates a memory leak while parsing TLS version
information. The leak was identified through fuzzing.

(cherry picked from commit 2823bc5aed)
6 years ago
Jeff Lucovsky 7ed5b9036a detect/ssl: Fix memory leak in version parsing
This commit fixes a memory leak in the SSL version handling that
manifests when the version identifier is incomplete or incorrect.

(cherry picked from commit 6bffe0bd35)
6 years ago
Victor Julien 1980e49d34 detect/pktvar: fix memory leaks
(cherry picked from commit aba4e19548)
6 years ago
Jeff Lucovsky da1260173a detect/threshold: Correct typos
(cherry picked from commit c20ab53eae)
6 years ago
Jeff Lucovsky 90de3c62cc detect/threshold: Don't allow duplicates
This commit detects duplicate threshold rule options. When duplicates
are found in a rule, an error message is displayed and the rule is
rejected.

(cherry picked from commit ff9a01ee1b)
6 years ago
Sascha Steinbiss 16fda46bf7 sip: address trailing space parsing
(cherry picked from commit 11912bd715)
6 years ago
Sascha Steinbiss 8b92e5c7ed snmp-version: make comment more clear
(cherry picked from commit efaa1755c6)
6 years ago
Sascha Steinbiss f6b5436fd1 snmp: do not set SIGMATCH_NOOPT
(cherry picked from commit f02a18e557)
6 years ago
Victor Julien 308f06c40e pcap/file: improve time handling
This patch addresses two problems.

First, various parts of the engine, but most notably the flow manager (FM),
use a minimum of the time notion of the packet threads. This did not
however, take into account the scenario where one or more of these
threads would be inactive for prolonged times. This could lead to the
time used by the FM could get stale.

This is addressed by keeping track of the last time the per thread packet
timestamp was updated, and only considering it for the 'minimum' when it
is reasonably current.

Second, there was a minor race condition at start up, where the FM would
already inspect the hash table(s) while the packet threads weren't active
yet. Since FM gets the time from the packet threads, it would use a bogus
time of 0.

This is addressed by adding a wait loop to the start of the FM that waits
for 'time' to get ready.

(cherry picked from commit 1e9333288f)
6 years ago
Victor Julien 34ec7f0f4f threads/time: rename ts to pktts to make purpose clear
(cherry picked from commit b605205032)
6 years ago
Victor Julien fc0c63ad89 pcap/file: fix race during pcap processing start
A race condition during the start of pcap file processing could cause
missed alerts and logged events. This race happens between the packet
threads and the flow manager. It was observed on slower hardware, but in
theory could happen on any machine. It required the 'autofp' runmode.

In commit 6f560144c1 ("time: improve offline time handling") the logic
was added to make the flow manager use a minimum of all the packet threads
perception of time.

The race condition was that the flow manager may become active _before_
all of the packet threads have started processing packets and thus setting
their timestamp. The threads that had not yet initialized their timestamp
would not be considered when calculating the minimum.

As a result of this, older packets timestamps would not yet be registered.
This would give the Flow Manager a timestamp too far in the future. While
the FM was running, the packet processing would start and a flow would
be created. This flow would then immediately be considered 'timed out' by
the FM, due to the timestamp too far in the future.

In the observed case, the thread processing packet 1 from the pcap had not
yet started processing while other threads had already started. The FM was
also already active. Due to the timestamps in the pcap this meant that the
time the FM used was about 500 seconds in the future compared to packet 1.

This patch fixes the issue by initializing all of the threads timestamps
with the timestamp value of the first packet. This way the minimum will
always consider this timestamp.

(cherry picked from commit 9f1922e175)
6 years ago
Victor Julien 0026be7ba4 pcap/file: fix function ptr naming
(cherry picked from commit 7f211dfb67)
6 years ago
Victor Julien a77f1e35f8 time: fix function name typo
(cherry picked from commit a765494dcb)
6 years ago
Victor Julien 90fa506894 time: remove unused time structure
(cherry picked from commit c68af5a23e)
6 years ago
Victor Julien e311beb060 time: minor code cleanup
(cherry picked from commit 0325d185a8)
6 years ago
Victor Julien dd7eb27532 stream/tcp: fix fast open off by one
With data on SYN the sequence number used for the first data
was off by one, leading to the next segments to appear to come
after a one byte gap.

(cherry picked from commit b85539b2ab)
6 years ago
Victor Julien 8af7637915 smb: fix rustc 1.42 warnings
(cherry picked from commit a729d266c3)
6 years ago
Victor Julien ae8f2e86c6 detect/parse: fix crash on 'internal' keyword use
When keyword __flowvar__postmatch__, an internal keyword, is used
in a rule the 'Setup' func ptr will be NULL. This caused a crash.

(cherry picked from commit 095981cb2a)
6 years ago
Victor Julien fdee23d8d8 detect/pkt_data: code and test cleanup
(cherry picked from commit e1c474a1b0)
6 years ago
Victor Julien 45bb7691a3 detect/pkt_data: error on unconsumed transforms
If a rule has transforms w/o consuming them (e.g. a content keyword),
don't consider 'pkt_data' valid.

(cherry picked from commit 13c9d0ca7e)
6 years ago
Victor Julien 6cd8a122b1 detect: more robust against transform issues
In case of transform issues (transform not consumed before pkt_data
for example), the code would hit an ugly BUG_ON.

Address this by a more graceful error message, that will still
invalidate the sig but not crash the engine.

(cherry picked from commit 7f19da1cc0)
6 years ago
Jeff Lucovsky 7751189682 tests/bsize: Fuzzing test case added
This commit adds a test case to validate the issue found during fuzz
testing.

(cherry picked from commit 0ae6b0b250)
6 years ago
Jeff Lucovsky 6f77c0d0ca detect/bsize: Ensure numeric values fit
This commit ensures that the numeric values will not exceed the size of
the containers used to hold them.

(cherry picked from commit 5b38bc9894)
6 years ago
Victor Julien 2fe01d93a5 decode/teredo: implement port support
Implement support for limiting Teredo detection and decoding to specific
UDP ports, with 3544 as the default.

If no ports are specified, the old behaviour of detecting/decoding on any
port is still in place. This can also be forced by specifying 'any' as the
port setting.

(cherry picked from commit e97cdb48f3)
6 years ago
Eric Leblond 3d3daf9611 configure: correctly display nss/nspr status
If autodiscovery of libnss was used (default), then the line
 libnss support:                          yes
was never set to no.

Same behavior for libnspr.

Broken by commit 'configure: fix nspr check logic' (7ea269a212)

(cherry picked from commit 752fc77cdc)
6 years ago
Victor Julien 27b6fada28 stream/tcp: fix STREAM_HAS_SEEN_DATA macro
The macro would not return true for smaller TCP streams, leading to
cases where the app-layer was not notified of EOF.

(cherry picked from commit e500c59b99)
6 years ago
Jeff Lucovsky 9f57dc84d9 actions: Use newer checkout action for some
Per-@jason, use action `checkout@v2` for CentOS-8, Debian 10 and Ubuntu
18.04
6 years ago
Jeff Lucovsky 3d7f654f37 doc: Remove bitmask documentation
This commit removes documentation for the never-implemented bitmask
option for the `byte_jump` and `byte_test` keywords.
6 years ago