]>
git.ipfire.org Git - thirdparty/suricata.git/log
Eric Leblond [Sun, 14 Oct 2012 17:24:22 +0000 (19:24 +0200)]
af-packet: fix possible infinite loop.
If no packet arrives to a capture thread, it is possible that the
AFPReadLoop() function goes into an infinite loop. This could cause
suricata to hang at exit on non busy system.
This patch adds a counter to detect when Suricata start looping in
the ring to stop when it reaches this point.
Eric Leblond [Sun, 14 Oct 2012 17:01:36 +0000 (19:01 +0200)]
af-packet: dump counter every seconds.
This patch updates to kernel counters handling to be almost sure to
update at least once per second.
Eric Leblond [Sun, 30 Sep 2012 14:20:05 +0000 (16:20 +0200)]
pf-ring: add counter for kernel drop and packets
This patch adds a counter for kernel drop and packets by using the
same strategy as the one used in af-packet.
Victor Julien [Tue, 30 Oct 2012 11:58:58 +0000 (12:58 +0100)]
Fix drop (and other actions) not being applied to thresholded packets. Bug #613.
Anoop Saldanha [Sun, 14 Oct 2012 20:56:13 +0000 (02:26 +0530)]
change default mpm to ac. Also default sgh-mpm-context is full.
Victor Julien [Thu, 25 Oct 2012 11:39:13 +0000 (13:39 +0200)]
Bug 585: use per detect thread libmagic ctx
Victor Julien [Wed, 24 Oct 2012 15:51:35 +0000 (17:51 +0200)]
magic: add test showing payload resulting in libmagic invalid read as reported by valgrind.
Anoop Saldanha [Sat, 20 Oct 2012 14:31:52 +0000 (20:01 +0530)]
fix flow deadlock issue in detection engine state introduced by tx api.
Issue discovered by coverity.
Eric Leblond [Tue, 23 Oct 2012 08:31:10 +0000 (10:31 +0200)]
suricata: list-keywords does not depend on unittest
Victor Julien [Tue, 23 Oct 2012 15:10:36 +0000 (17:10 +0200)]
luajit: suppress compiler warning
Anoop Saldanha [Fri, 19 Oct 2012 09:40:14 +0000 (15:10 +0530)]
fix segv in hcbd and hsbd buffering.
Increase bufffers_list_len, only we open up a space for a new tx.
Anoop Saldanha [Sat, 20 Oct 2012 06:02:22 +0000 (11:32 +0530)]
unittest to reveal a bug/segv in our hsbd buffering code.
Victor Julien [Fri, 19 Oct 2012 09:44:51 +0000 (11:44 +0200)]
http: fix http header reassembly bug causing some headers to be left out of the inspected buffer
Victor Julien [Wed, 17 Oct 2012 16:24:56 +0000 (18:24 +0200)]
http: now that htp_state has a cfg reference, use it for body limits
Victor Julien [Wed, 17 Oct 2012 16:15:37 +0000 (18:15 +0200)]
http: allow configuration of request and response body inspection limits. Issue #560.
Anoop Saldanha [Sun, 14 Oct 2012 20:14:17 +0000 (01:44 +0530)]
New app inspection engine introduced. Moved existing inspecting engines to use it.
Anoop Saldanha [Sun, 14 Oct 2012 14:16:46 +0000 (19:46 +0530)]
Change all inspect callbacks to accept TV and a tx_id param.
Anoop Saldanha [Sun, 14 Oct 2012 10:49:53 +0000 (16:19 +0530)]
Engine cleanup. Remove all old engine inspection and mpm functions.
Anoop Saldanha [Sat, 13 Oct 2012 18:13:20 +0000 (23:43 +0530)]
update client/server/http_header to use a different form of
buffering/buffer_retrieval.
Now it happens per tx, based on tx id. Also notice a perf improvement with
this.
Victor Julien [Wed, 17 Oct 2012 07:25:52 +0000 (09:25 +0200)]
stream: change how retransmissions are handled and detected.
Victor Julien [Tue, 16 Oct 2012 14:21:00 +0000 (16:21 +0200)]
stream: fix retransmission on closewait being considered out of window
Victor Julien [Tue, 16 Oct 2012 13:53:48 +0000 (15:53 +0200)]
stream: detect retransmissions on timewait state
Victor Julien [Tue, 16 Oct 2012 13:39:34 +0000 (15:39 +0200)]
stream: accept ack with next_seq + 1 on last_ack state
Victor Julien [Tue, 16 Oct 2012 13:37:56 +0000 (15:37 +0200)]
stream: disable retransmission packet before last ack sig as it is fairly common in regular traffic
Victor Julien [Tue, 16 Oct 2012 13:27:30 +0000 (15:27 +0200)]
stream: detect retransmissions on closewait and finwait2 states
Victor Julien [Tue, 16 Oct 2012 12:52:29 +0000 (14:52 +0200)]
stream: don't flag zero window probe packets as out of window. Bug #604.
Victor Julien [Tue, 16 Oct 2012 12:09:58 +0000 (14:09 +0200)]
stream: detect keep-alive packets so we don't consider those invalid
Victor Julien [Tue, 16 Oct 2012 11:27:58 +0000 (13:27 +0200)]
stream: ignore ack value if ack flag is not set. Add stream.pkt_broken_ack event for when ack value is not 0 and ack flag not set.
Victor Julien [Tue, 16 Oct 2012 09:55:36 +0000 (11:55 +0200)]
stream: handle retransmission of lost data packet on TIME_WAIT state
Victor Julien [Tue, 16 Oct 2012 09:14:59 +0000 (11:14 +0200)]
stream: go from FIN_WAIT_1 to CLOSING on simultaneous close.
Victor Julien [Tue, 16 Oct 2012 08:50:39 +0000 (10:50 +0200)]
stream: don't reject RST as response to SYN because of ACK
Victor Julien [Thu, 11 Oct 2012 19:02:56 +0000 (21:02 +0200)]
stream: add option to match on overlapping data
Set event on overlapping data segments that have different data.
Add stream-events option stream-event:reassembly_overlap_different_data and
add an example rule.
Issue 603.
Victor Julien [Fri, 12 Oct 2012 14:40:43 +0000 (16:40 +0200)]
libhtp: don't use internal iterator
It violates thread safety. #601.
Suricata assures thread safety on the flow level for HTTP tracking. Part of the flow is (in case of HTTP) libhtp's htp_connp_t state. At startup the libhtp glue layer, app-layer-htp initializes as many htp_cfg_t instances as there are libhtp server configurations in the yaml. At HTTP session start, we look up the proper htp_cfg_t based on the server ip and pass it to htp_connp_create. A ptr to the relevant htp_cfg_t is part of the htp_connp_t. The htp_cfg_t contains "hooks". The are registered based on yaml config at init time.
The hooks have lists of type list_t. The list is run with a built in iterator. The iterator is reset at the start of each "hook_run_all". Since multiple flows share the same htp_cfg_t flow A can reset the iterator while flow B is using it. The flow lock has no effect as flows share the htp_cfg_t.
This has been observed in real traffic. hook_response_body_data was run on the same data multiple times, leading to corrupt extracted files.
Victor Julien [Tue, 9 Oct 2012 15:22:42 +0000 (17:22 +0200)]
Fix/suppress a couple of harmless compiler warnings.
Anoop Saldanha [Wed, 10 Oct 2012 08:43:36 +0000 (14:13 +0530)]
Remove dead comment about flow reference api duplicate
Anoop Saldanha [Fri, 5 Oct 2012 12:22:37 +0000 (17:52 +0530)]
Move Flow Reference/Dereferene api from flow-util.h to flow.h.
Remove duplicate FlowDeReference from decode.h
Anoop Saldanha [Fri, 5 Oct 2012 09:37:27 +0000 (15:07 +0530)]
Update suricata to use FlowReference/FlowDeReference for the ones left out
from last update.
Victor Julien [Tue, 9 Oct 2012 13:16:12 +0000 (15:16 +0200)]
yaml: default to cluster_flow type for AF_PACKET and PF_RING
Victor Julien [Mon, 8 Oct 2012 10:38:47 +0000 (12:38 +0200)]
profiling: fix rule profiling output sometimes missing sid,rev,gid. Bug #576.
Victor Julien [Sat, 6 Oct 2012 18:00:22 +0000 (20:00 +0200)]
Add dsize check to prefilter stage
Many sigs with dsize have a weak fast_pattern. Those patterns
are likely to match. By filtering on dsize early, we safe a lot
of cycles later.
Victor Julien [Wed, 18 May 2011 17:07:51 +0000 (19:07 +0200)]
For signatures with the dsize option set depth on any content match in that sig.
Victor Julien [Thu, 4 Oct 2012 13:01:36 +0000 (15:01 +0200)]
Update changelog to reflect 1.4beta2 changes
Victor Julien [Thu, 4 Oct 2012 12:59:58 +0000 (14:59 +0200)]
Clean up and update bundled docs
Victor Julien [Thu, 4 Oct 2012 12:52:22 +0000 (14:52 +0200)]
remove reference to non-existing file from Makefile.am
Victor Julien [Thu, 4 Oct 2012 11:20:27 +0000 (13:20 +0200)]
packet src: move pkt_src field up in the structure to fix in an existing hole (found with pahole -C Packet_ src/.libs/suricata).
Anoop Saldanha [Sat, 29 Sep 2012 04:59:56 +0000 (10:29 +0530)]
Add a packet src for every packet generated inside suricata.
Eric Leblond [Thu, 4 Oct 2012 09:53:29 +0000 (11:53 +0200)]
nfq: fix detection of type nfq_get_payload function.
Eric Leblond [Thu, 4 Oct 2012 09:06:33 +0000 (11:06 +0200)]
nfq: close the queue when leaving acquisition.
This patch adds a call to close the queue when the acquisition
loop is ending. This way the incoming packets will be accepted
during all the shutdown phase (if the queue-bypass option of
NFQUEUE is used). At the same time the currently processed packets
will be dropped but the time scale are different: suricata will
drop 20 ms of packets and the shutdown can take 0.5 seconds.
Patch based on an idea of Victor Julien.
Victor Julien [Thu, 4 Oct 2012 09:48:42 +0000 (11:48 +0200)]
fast_pattern: don't consider http_method, http_stat_code and http_stat_msg when automatically giving preference to a HTTP pattern over a stream pattern.
Eric Leblond [Wed, 3 Oct 2012 08:34:09 +0000 (10:34 +0200)]
pf-ring: suppress unused variable.
Eric Leblond [Sun, 30 Sep 2012 14:19:53 +0000 (16:19 +0200)]
pf-ring: add missing header.
Eric Leblond [Sun, 30 Sep 2012 14:18:10 +0000 (16:18 +0200)]
pf-ring: protect definition of (un)likely
This patch makes (un)likely declared if and only if they are not
declared before.
Anoop Saldanha [Thu, 4 Oct 2012 07:29:58 +0000 (12:59 +0530)]
fix for bug #574.
More of a temporary solution to prevent any possible FPs. Disable content
inspection bypass for mpm patterns.
Anoop Saldanha [Tue, 2 Oct 2012 15:43:35 +0000 (21:13 +0530)]
fix for bug #577.
If a pattern has matched on mpm, don't re-inspect it later, subject to certain
conditions met by the pattern - namely, not negated, right chop, no replacet
attached to it.
Victor Julien [Wed, 3 Oct 2012 13:43:43 +0000 (15:43 +0200)]
htp: update version numbers of bundled htp
Victor Julien [Wed, 3 Oct 2012 09:37:04 +0000 (11:37 +0200)]
http: fix multipart parsing leading to missing chunks of files in file extraction.
Anoop Saldanha [Wed, 26 Sep 2012 16:48:02 +0000 (22:18 +0530)]
Make available custom features of libhtp.
The power of libhtp customisation now available to users.
Options available -
path-backslash-separators: yes
path-compress-separators: yes
path-control-char-handling: none
path-convert-utf8: yes
path-decode-separators: yes
path-decode-u-encoding: yes
path-invalid-encoding-handling: preserve_percent
path-invalid-utf8-handling: none
path-nul-encoded-handling: none
path-nul-raw-handling: none
set-path-replacement-char: ?
set-path-unicode-mapping: bestfit
You can use this for your libhtp customisation. Options explained in our
wiki.
https://redmine.openinfosecfoundation.org/projects/suricata/wiki/Advanced_libhtp_customization
Anoop Saldanha [Wed, 26 Sep 2012 15:40:15 +0000 (21:10 +0530)]
refactor htpconfigure()
Victor Julien [Tue, 2 Oct 2012 11:56:12 +0000 (13:56 +0200)]
bug #572: make sure we use profiling fallback for all architectures except x86_64 and i386.
Victor Julien [Tue, 2 Oct 2012 08:27:12 +0000 (10:27 +0200)]
Fix flow keyword compilation failure.
Anoop Saldanha [Thu, 27 Sep 2012 12:55:37 +0000 (18:25 +0530)]
Update all flow referencing to use the new FlowReference and FlowDeReference
macros.
Anoop Saldanha [Thu, 27 Sep 2012 09:12:49 +0000 (14:42 +0530)]
fix for bug #557.
In FFRv2, dereference flow from a packet using the new reference/dereference
util macros. This allows the decr use_cnt for flow and reseting the flow
pointer to NULL for the pseudo pkt to happen simultaneously, in case there we
fail to retrieve a pseudo_packet and have to return the already obtained
pseudo packets, back to the packetpool.
Anoop Saldanha [Thu, 27 Sep 2012 09:10:07 +0000 (14:40 +0530)]
Introduce utility flow macros to help referencing/dereferencing flows.
Anoop Saldanha [Wed, 26 Sep 2012 17:17:53 +0000 (22:47 +0530)]
fix for bug #557.
Reset hhd buffers list len if we exit before allocating the buffer.
Anoop Saldanha [Mon, 1 Oct 2012 16:25:56 +0000 (21:55 +0530)]
fix for bug #575.
If sig has no_stream set, don't mask it as requiring flow. Should get rid of
FNs any.
Victor Julien [Fri, 28 Sep 2012 17:49:34 +0000 (19:49 +0200)]
detect: properly store a stateful match if it happens at the start of inspection
Victor Julien [Thu, 27 Sep 2012 10:53:54 +0000 (12:53 +0200)]
Dead code cleanup. Coverity 728047, 728048, 728049.
Victor Julien [Wed, 26 Sep 2012 16:56:24 +0000 (18:56 +0200)]
profiling: fix some profiling info missing from output
Eric Leblond [Wed, 26 Sep 2012 14:03:33 +0000 (16:03 +0200)]
tm-thread: detect thread death
When a thread is dead at init the THV_INIT_DONE flag is not set
and the spawn function can freeze (see bug #553 for an example).
In this case THV_RUNNING_DONE is set and we can also check on this
state for leaving the function. This should fix #bug553
Victor Julien [Wed, 26 Sep 2012 09:42:53 +0000 (11:42 +0200)]
threshold: improve comments of shipped threshold.config, add links to wiki.
Anoop Saldanha [Tue, 25 Sep 2012 14:53:29 +0000 (20:23 +0530)]
fix http server/client body handling. Update body status based on tx state.
Victor Julien [Wed, 26 Sep 2012 06:58:05 +0000 (08:58 +0200)]
threshold: allow threshold.config to override rule
Allow threshold.conf to override rule thresholds in the following
cases:
- threshold.config rule uses threshold or event_filter AND
- threshold.config rule applies to a single signature (so no
gid 0 or sid 0)
Confirmed to work with both threshold and detection_filter rule
keywords.
Part of bug #425.
Victor Julien [Wed, 26 Sep 2012 05:17:54 +0000 (07:17 +0200)]
Minor parsing cleanups in detect-engine options.
Victor Julien [Tue, 25 Sep 2012 12:46:51 +0000 (14:46 +0200)]
yaml: add addr and port vars commonly used by ET/ETpro
Eric Leblond [Fri, 21 Sep 2012 10:47:44 +0000 (12:47 +0200)]
coccinelle: add test on malloc error check.
This patch adds a coccinelle code check on SCMalloc, SCCalloc and
SCStrdup and other memory handling functions. It verifies that the
error checking is made.
Eric Leblond [Mon, 24 Sep 2012 11:24:29 +0000 (13:24 +0200)]
Fix indentation of win32 files.
Eric Leblond [Mon, 24 Sep 2012 11:02:30 +0000 (13:02 +0200)]
Add missing sctrdup test
Eric Leblond [Sun, 23 Sep 2012 16:05:32 +0000 (18:05 +0200)]
coccinelle: don't test UNITTEST code
Eric Leblond [Sun, 23 Sep 2012 13:56:00 +0000 (15:56 +0200)]
Use unlikely for error treatment.
When handling error case on SCMallog, SCCalloc or SCStrdup
we are in an unlikely case. This patch adds the unlikely()
expression to indicate this to gcc.
This patch has been obtained via coccinelle. The transformation
is the following:
@istested@
identifier x;
statement S1;
identifier func =~ "(SCMalloc|SCStrdup|SCCalloc)";
@@
x = func(...)
... when != x
- if (x == NULL) S1
+ if (unlikely(x == NULL)) S1
Eric Leblond [Fri, 21 Sep 2012 21:26:53 +0000 (23:26 +0200)]
Add some missing checks of SCStrdup return.
Eric Leblond [Fri, 21 Sep 2012 13:24:17 +0000 (15:24 +0200)]
Add some missing checks of SCMalloc return.
Victor Julien [Mon, 24 Sep 2012 14:53:59 +0000 (16:53 +0200)]
threshold: allow suppression for sigs with threshold set. Part of #425.
Anoop Saldanha [Fri, 21 Sep 2012 18:44:01 +0000 (00:14 +0530)]
fix for #529
Respect pcre's anchor during content inspection.
Anoop Saldanha [Mon, 24 Sep 2012 10:32:07 +0000 (16:02 +0530)]
Unittest to display #bug 529. pcre anchor not respected
Anoop Saldanha [Fri, 21 Sep 2012 17:48:11 +0000 (23:18 +0530)]
detect-pcre.c cleanup. Delete old pcre functions that we no longer use.
Eric Leblond [Wed, 19 Sep 2012 14:40:14 +0000 (16:40 +0200)]
af-packet: clean APFPacketVar before release.
This patch resets the AFPPacketVar linked to a Packet in the release
function to avoid any side effect when the packet is reused. To do
so a new AFPV_CLEANUP macro has been introduced.
Eric Leblond [Wed, 19 Sep 2012 13:40:54 +0000 (15:40 +0200)]
decode: clean release function
Anoop Saldanha [Fri, 21 Sep 2012 15:15:17 +0000 (20:45 +0530)]
Give priority to non stream content over stream content when selecting fast
pattern.
Victor Julien [Fri, 21 Sep 2012 15:43:11 +0000 (17:43 +0200)]
Minor output cleanup
Victor Julien [Fri, 21 Sep 2012 15:39:32 +0000 (17:39 +0200)]
Fix defrag compilation warning.
Victor Julien [Fri, 21 Sep 2012 14:59:27 +0000 (16:59 +0200)]
Fix compilation if luajit is disabled.
Victor Julien [Fri, 21 Sep 2012 14:36:48 +0000 (16:36 +0200)]
luajit: correct offset passed to script for lua's array idx starting at 1. Add http.response_headers and http.response_headers.raw buffers.
Victor Julien [Fri, 21 Sep 2012 13:10:28 +0000 (15:10 +0200)]
reintroduce pool free func for cases where block alloc is not used.
Victor Julien [Fri, 21 Sep 2012 12:18:53 +0000 (14:18 +0200)]
luajit: prealloc lua states to increases chances of alloc success. Luajit requires them to be in memory <2GB.
Victor Julien [Fri, 21 Sep 2012 12:17:42 +0000 (14:17 +0200)]
pool: only alloc one large block if it will actually be used.
Victor Julien [Thu, 20 Sep 2012 20:09:30 +0000 (22:09 +0200)]
luajit: fix crash at shutdown / rule reload if lua script didn't properly init.
Eric Leblond [Thu, 20 Sep 2012 07:14:58 +0000 (09:14 +0200)]
Add missing include in flow-manager
DefragTimeoutHash was not declared before being used.
Victor Julien [Thu, 20 Sep 2012 13:19:51 +0000 (15:19 +0200)]
luajit: fix crash if luaL_newstate fails
Victor Julien [Thu, 20 Sep 2012 07:48:38 +0000 (09:48 +0200)]
luajit: buffer selection fixes
Victor Julien [Thu, 20 Sep 2012 12:46:22 +0000 (14:46 +0200)]
http: fix multipart parsing bug