]> git.ipfire.org Git - thirdparty/suricata.git/log
thirdparty/suricata.git
12 years agoDefrag engine
Victor Julien [Tue, 18 Sep 2012 16:13:09 +0000 (18:13 +0200)] 
Defrag engine

Big rewrite of defrag engine to make it more scalable and fix some
locking logic flaws.

Now uses a hash of trackers similar to Flow and Host hashes.

12 years agoprofiling: fix build on older systems
Victor Julien [Mon, 17 Sep 2012 09:21:26 +0000 (11:21 +0200)] 
profiling: fix build on older systems

12 years agoautotools: fix doc install on old systems. 73/head
Eric Leblond [Mon, 17 Sep 2012 09:11:47 +0000 (11:11 +0200)] 
autotools: fix doc install on old systems.

12 years agoprofiling: remove obsolete unit test
Victor Julien [Mon, 17 Sep 2012 08:38:39 +0000 (10:38 +0200)] 
profiling: remove obsolete unit test

12 years agopf_ring: set cluster_id even if only one thread is used.
Eric Leblond [Fri, 14 Sep 2012 16:06:37 +0000 (18:06 +0200)] 
pf_ring: set cluster_id even if only one thread is used.

12 years agoprofiling: minor cleanup
Victor Julien [Mon, 17 Sep 2012 08:34:34 +0000 (10:34 +0200)] 
profiling: minor cleanup

12 years agoprofiling: make sure counters are reset after a reload.
Victor Julien [Mon, 17 Sep 2012 07:56:52 +0000 (09:56 +0200)] 
profiling: make sure counters are reset after a reload.

12 years agoprofiling: fix memory error in case of rule reload.
Victor Julien [Sun, 16 Sep 2012 10:57:53 +0000 (12:57 +0200)] 
profiling: fix memory error in case of rule reload.

12 years agoRule profiling update
Victor Julien [Sun, 16 Sep 2012 10:08:35 +0000 (12:08 +0200)] 
Rule profiling update

- Remove usage of counters api.
- Store stats in detect engine thread ctx to remove locking
- Support rule reloads

12 years agoluajit: add http.uri.raw, cookie, ua, headers, headers.raw buffers.
Victor Julien [Fri, 14 Sep 2012 05:59:57 +0000 (07:59 +0200)] 
luajit: add http.uri.raw, cookie, ua, headers, headers.raw buffers.

12 years agoFix build if luajit is not available.
Eric Leblond [Thu, 13 Sep 2012 12:52:42 +0000 (14:52 +0200)] 
Fix build if luajit is not available.

12 years agodefrag: don't return after a cleaning. 69/head
Eric Leblond [Thu, 13 Sep 2012 09:57:07 +0000 (11:57 +0200)] 
defrag: don't return after a cleaning.

This patch changes the policy of the timeout function by cleaning
every timeouted trackers.
Previous code was only freeing the first tracker and this was resulting
in calling the timeout function continuously. One of my previous patch
has modified the function to avoid to run it more than twice a second.
But as it was not taken into account the fact only the first tracker was
freed, the result was that a lot of tracker could not be allocated.

12 years agoluajit: support http.request_body (http_client_body) and http.response_body (file_dat...
Victor Julien [Wed, 12 Sep 2012 15:52:57 +0000 (17:52 +0200)] 
luajit: support http.request_body (http_client_body) and http.response_body (file_data/http_server_body).

12 years agoluajit: clean up initialization
Victor Julien [Sun, 9 Sep 2012 13:46:11 +0000 (15:46 +0200)] 
luajit: clean up initialization

12 years agoInstall documentation with 'make install'.
Eric Leblond [Mon, 10 Sep 2012 09:18:07 +0000 (11:18 +0200)] 
Install documentation with 'make install'.

12 years agopool: rename Free function to Cleanup
Eric Leblond [Mon, 10 Sep 2012 07:06:41 +0000 (09:06 +0200)] 
pool: rename Free function to Cleanup

This patch renames Free functions to Cleanup as the free is made
by the pool system.

12 years agodefrag: don't use message for repetitive error 65/head
Eric Leblond [Sun, 9 Sep 2012 20:48:46 +0000 (22:48 +0200)] 
defrag: don't use message for repetitive error

When nothing can be fetch from the pool, this can repeat frequently.
Thus displaying a message in the log will not help. This patch
uses a counter instead of a log message. As this is a sort of memcap
this is conformed to what is done for other issues of the same type.

12 years agoSC_LOG_ERROR is not an error.
Eric Leblond [Fri, 7 Sep 2012 11:54:35 +0000 (13:54 +0200)] 
SC_LOG_ERROR is not an error.

12 years agoFix warning about unused return of SC_ATOMIC func.
Eric Leblond [Fri, 7 Sep 2012 11:53:44 +0000 (13:53 +0200)] 
Fix warning about unused return of SC_ATOMIC func.

12 years agoFix invalid usage of operator.
Eric Leblond [Fri, 7 Sep 2012 11:52:21 +0000 (13:52 +0200)] 
Fix invalid usage of operator.

12 years agofreebsd: fix warning about redeclaration.
Eric Leblond [Fri, 7 Sep 2012 11:31:03 +0000 (13:31 +0200)] 
freebsd: fix warning about redeclaration.

12 years agofreebsd: fix warning
Eric Leblond [Fri, 7 Sep 2012 11:25:35 +0000 (13:25 +0200)] 
freebsd: fix warning

12 years agoipfw: avoid critical error for broadcast
Eric Leblond [Fri, 7 Sep 2012 11:18:35 +0000 (13:18 +0200)] 
ipfw: avoid critical error for broadcast

In some setup, suricata may receive broadcast packets and the call
to sendto may fail if the wrong interface is choosen by kernel.
This patch change the error treatment to avoid to leave when
this problem occurs.

12 years agoipfw: add missing include
Eric Leblond [Fri, 7 Sep 2012 09:20:18 +0000 (11:20 +0200)] 
ipfw: add missing include

12 years agoautotools: fix default path for magic file.
Eric Leblond [Fri, 7 Sep 2012 08:52:37 +0000 (10:52 +0200)] 
autotools: fix default path for magic file.

12 years agofreebsd: fix function usage.
Eric Leblond [Thu, 6 Sep 2012 20:39:02 +0000 (22:39 +0200)] 
freebsd: fix function usage.

The unlock function was not correctly used in error treatment.

12 years agoDo not trim the FCS, pcaps converted to ERF will have have an FCS.
Jason Ish [Fri, 7 Sep 2012 16:22:38 +0000 (10:22 -0600)] 
Do not trim the FCS, pcaps converted to ERF will have have an FCS.

12 years agoaf-packet: fix looping in ring buffer. 64/head
Eric Leblond [Sat, 8 Sep 2012 09:48:59 +0000 (11:48 +0200)] 
af-packet: fix looping in ring buffer.

A crash can occurs in the following conditions:
 * Suricata running in other mode than "workers"
 * Kernel fill in the ring buffer
Under this conditions, it is possible that the capture thread reads
a packet that has not yet released by one of the treatment threads
because there is no modification done on the ring buffer entry when
a packet is read. Doing, this it access to memory which can be
released to the kernel and modified. This results in a kind of memory
corruption.

This bug has only been seen recently and this has to be linked with the
read speed improvement recently made in AF_PACKET support.

The patch fixes the issue by modifying the tp_status bitmask in the
ring buffer. It sets the TP_STATUS_USER_BUSY flag when it is confirmed
that the packet will be treated. And at the start of the read, it exits
from the reading loop (returning to poll) when it reaches a packet with
the flag set. As tp_status is set to 0 during packet release the flag
is destroyed when releasing the packet.

Regarding concurrency, we've got a sequence of modification. The
capture thread read the packet and set the flag, then it passes the
queue and the packet get processed by other threads. The change on
tp_status are thus made at different time.

Regarding the value of the flag, the patch uses the last bit of
tp_status to avoid be impacting by a change in kernel. I will
propose a patch to have TP_STATUS_USER_BUSY included in kernel
as this is a generic issue for multithreading application using
AF_PACKET mechanism.

12 years agoluajit: add http.uri and http.request_line buffers.
Victor Julien [Sat, 8 Sep 2012 09:10:21 +0000 (11:10 +0200)] 
luajit: add http.uri and http.request_line buffers.

12 years agoluajit: fix filtering payload or pkt when not available yet
Victor Julien [Fri, 7 Sep 2012 17:36:18 +0000 (19:36 +0200)] 
luajit: fix filtering payload or pkt when not available yet

12 years agoluajit: force scripts to have 'init' function that returns a table of 'needs' such...
Victor Julien [Fri, 7 Sep 2012 13:04:34 +0000 (15:04 +0200)] 
luajit: force scripts to have 'init' function that returns a table of 'needs' such as packet or payload.

12 years agoUpdate changelog for 1.4beta1 suricata-1.4beta1
Victor Julien [Thu, 6 Sep 2012 13:41:43 +0000 (15:41 +0200)] 
Update changelog for 1.4beta1

12 years agopool: improve error handling 59/head
Eric Leblond [Thu, 6 Sep 2012 11:57:20 +0000 (13:57 +0200)] 
pool: improve error handling

Error handling during Pool creation was not perfect as a PoolBucket
could leak.

12 years agoMake sure defrag pool sizes are not initialized to 0, see #540.
Victor Julien [Thu, 6 Sep 2012 11:48:55 +0000 (13:48 +0200)] 
Make sure defrag pool sizes are not initialized to 0, see #540.

12 years agotls: fix error handling
Eric Leblond [Thu, 6 Sep 2012 10:03:54 +0000 (12:03 +0200)] 
tls: fix error handling

Handling of error case was correct as pointed out by Coverity
717439.

12 years agotls: avoid double close.
Eric Leblond [Thu, 6 Sep 2012 09:44:25 +0000 (11:44 +0200)] 
tls: avoid double close.

This should fix issue 717441 reported by Coverity.

12 years agodefrag: be sure to output NULL tracker
Eric Leblond [Thu, 6 Sep 2012 09:31:42 +0000 (11:31 +0200)] 
defrag: be sure to output NULL tracker

Coverity 720337 pointed out a use after free. We can't be dependent
to HashListTableAdd outputting a NULL tracker.

12 years agoFix coverity warnings 718636 and 718635
Eric Leblond [Thu, 6 Sep 2012 07:59:14 +0000 (09:59 +0200)] 
Fix coverity warnings 718636 and 718635

The result of the swap was not checked.

12 years agodefrag: fix potential use after free.
Eric Leblond [Thu, 6 Sep 2012 07:44:31 +0000 (09:44 +0200)] 
defrag: fix potential use after free.

Coverity pointed out that PoolReturn is almost like free and detected
a use after free when accessing to tracker->af (issue 720339).
This patch fixes this by storing the value in a local variable.

12 years agodefrag: avoid to run cleaning repetitively
Eric Leblond [Thu, 6 Sep 2012 06:41:17 +0000 (08:41 +0200)] 
defrag: avoid to run cleaning repetitively

12 years agoaf-packet: handle possible exit of capture loop.
Eric Leblond [Wed, 5 Sep 2012 13:32:11 +0000 (15:32 +0200)] 
af-packet: handle possible exit of capture loop.

If a capture loop does exit, the thread needs to start without
synchronization with the other threads. This patch fixes this
by resetting the turn count on the peerslist structure and
adding a test on this condition in the wait function.

12 years agoaf-packet: fix kernel offset issue
Eric Leblond [Tue, 4 Sep 2012 22:15:16 +0000 (00:15 +0200)] 
af-packet: fix kernel offset issue

It seems that, in some case, there is a read waiting but the
offset in the ring buffer is not correct and Suricata need to
walk the ring to find the correct place and make the read.

12 years agoaf-packet: fix emergency mode
Eric Leblond [Tue, 4 Sep 2012 16:43:01 +0000 (18:43 +0200)] 
af-packet: fix emergency mode

This patch fixes emergency mode by setting the variable even if we
have a non kernel checksum check. It also does a call to
AFPDUmpCounters() as it seems to improve thing to do it ASAP.

12 years agoaf-packet: implement late open
Eric Leblond [Tue, 4 Sep 2012 10:14:58 +0000 (12:14 +0200)] 
af-packet: implement late open

This patch implements "late open". On high performance system, it
is needed to create the AF_PACKET just before reading to avoid
overflow. Socket creation has to be done with respect to the order
of thread creation to respect affinity settings.
This patch adds a counter to AFPPeer to be ale to synchronize the
initial socket creation.

12 years agoaf-packet: improve logged messages.
Eric Leblond [Tue, 4 Sep 2012 09:20:05 +0000 (11:20 +0200)] 
af-packet: improve logged messages.

12 years agoaf-packet: rework socket transition phase.
Eric Leblond [Mon, 3 Sep 2012 14:43:45 +0000 (16:43 +0200)] 
af-packet: rework socket transition phase.

Suricata was not able to start cleanly in AF_PACKET with default
suricata.yaml file if there was no eth1 on the system. This patch
fixes this issue and rework the socket transition phase to fix
some serious issues (file descriptor leak) found when fixing this
problem.
Every 20 seconds it displays a message to the user to warn him about
the interface not being accessible:
  [ERRCODE: SC_ERR_AFP_CREATE(196)] - Can not open iface 'eth1'

12 years agoaf-packet: ring mode is not optionnal in AFPReadFromRing
Eric Leblond [Mon, 3 Sep 2012 16:38:45 +0000 (18:38 +0200)] 
af-packet: ring mode is not optionnal in AFPReadFromRing

12 years agoFix 'no effect' check in timestamp print logic. Coverity 717437.
Victor Julien [Thu, 6 Sep 2012 08:11:57 +0000 (10:11 +0200)] 
Fix 'no effect' check in timestamp print logic. Coverity 717437.

12 years agoCheck response headers in custom http logging before using them. Coverity 717436.
Victor Julien [Thu, 6 Sep 2012 08:09:14 +0000 (10:09 +0200)] 
Check response headers in custom http logging before using them. Coverity 717436.

12 years agodecode: use pointer inside packet area as param
Eric Leblond [Wed, 5 Sep 2012 12:09:57 +0000 (14:09 +0200)] 
decode: use pointer inside packet area as param

DecodeTeredo, DecodeIPv6InIPv6 and DecodeIPv4inIPv6 were calling
DecodeTunnel with packet being a pseudo packet and data being
data from initial packet:
        DecodeTunnel(tv, dtv, tp, start, blen,
                     pq, IPPROTO_IPV6);
In decoding functions, arithmetic was done on pkt to set some values?
It was resulting in field of packet  pointing outside of the scope of
packet data.
This patch switch to what has been done in DecodeGre(), I mean:
        DecodeTunnel(tv, dtv, tp, GET_PKT_DATA(tp),
                     GET_PKT_LEN(tp), pq, IPPROTO_IP);
Data buffer is then relative to the packet and the arithmetic is
correct.

12 years agoaffinity: drop capability after setting thread prio
Eric Leblond [Wed, 5 Sep 2012 06:56:33 +0000 (08:56 +0200)] 
affinity: drop capability after setting thread prio

Setting thread priority can require privilege if a low nice value
has to be set up.

12 years agoaffinity: add call to setup function in threads
Eric Leblond [Wed, 5 Sep 2012 06:53:41 +0000 (08:53 +0200)] 
affinity: add call to setup function in threads

Threads created through TMThreadSpawn need to call the affinity
function by themselves.

12 years agoaffinity: tag management threads as such
Eric Leblond [Tue, 4 Sep 2012 15:48:14 +0000 (17:48 +0200)] 
affinity: tag management threads as such

The management threads were not tagged for CPU affinity and thus
the setting was not applied.

12 years agoaffinity: add log message
Eric Leblond [Wed, 5 Sep 2012 07:21:28 +0000 (09:21 +0200)] 
affinity: add log message

12 years agoAdd threshold.config example to EXTRA_DIST as well.
Victor Julien [Thu, 6 Sep 2012 05:43:00 +0000 (07:43 +0200)] 
Add threshold.config example to EXTRA_DIST as well.

12 years agoAdd threshold.config file.
Eric Leblond [Wed, 5 Sep 2012 15:08:54 +0000 (17:08 +0200)] 
Add threshold.config file.

This patch adds an example file and modify Makefile to have it
installed by 'make install-conf' command.

12 years agoAdd --enable-luajit option to configure
Victor Julien [Thu, 6 Sep 2012 05:30:31 +0000 (07:30 +0200)] 
Add --enable-luajit option to configure

12 years agoerf: fix logical operator usage.
Eric Leblond [Tue, 4 Sep 2012 11:35:15 +0000 (13:35 +0200)] 
erf: fix logical operator usage.

12 years agoImplement logic of luajit keyword to match on full packet data and/or payload.
Victor Julien [Wed, 5 Sep 2012 15:33:46 +0000 (17:33 +0200)] 
Implement logic of luajit keyword to match on full packet data and/or payload.

12 years agoThread local ctx for detection keywords
Victor Julien [Wed, 5 Sep 2012 11:23:53 +0000 (13:23 +0200)] 
Thread local ctx for detection keywords

Some detection keywords need thread local ctx storage. Example is the
filemagic keyword that has a ctx that is modified with each call. That
is not thread safe. This functionality allows registration of thread
local ctxs so that each detect thread works on it's own copy.

12 years agoluajit: stub detection keyword
Victor Julien [Tue, 4 Sep 2012 16:00:56 +0000 (18:00 +0200)] 
luajit: stub detection keyword

12 years agoluajit: tell build sys about it
Victor Julien [Tue, 4 Sep 2012 15:34:17 +0000 (17:34 +0200)] 
luajit: tell build sys about it

12 years agoaf-packet: fix build on systems without AF_PACKET
Eric Leblond [Mon, 3 Sep 2012 14:57:21 +0000 (16:57 +0200)] 
af-packet: fix build on systems without AF_PACKET

12 years agodoxygen: generate doc for acquisition modules
Eric Leblond [Thu, 30 Aug 2012 07:54:53 +0000 (09:54 +0200)] 
doxygen: generate doc for acquisition modules

This patch sets some define to generate doc for the acquisition
modules. It also suppress the doc generation for unittests which
was polluting the output.

12 years agopool: update doxygen documentation.
Eric Leblond [Thu, 30 Aug 2012 07:54:34 +0000 (09:54 +0200)] 
pool: update doxygen documentation.

12 years agopool: realize a block allocation for preallocated item.
Eric Leblond [Wed, 29 Aug 2012 10:27:26 +0000 (12:27 +0200)] 
pool: realize a block allocation for preallocated item.

This patch required a evolution of Pool API as it is needed to
proceed to alloc or init separetely. The PoolInit has been changed
with a new Init function parameter.

12 years agopool: alloc a single area for all PoolBuckets
Eric Leblond [Thu, 26 Jul 2012 13:02:20 +0000 (15:02 +0200)] 
pool: alloc a single area for all PoolBuckets

As we know the number and the size of PoolBucket, we can simply
allocate a single memory zone.

12 years agol3proto: add unit tests
Eric Leblond [Wed, 22 Aug 2012 13:39:27 +0000 (15:39 +0200)] 
l3proto: add unit tests

This patch adds a series of unit tests. First two check test the keyword
by checking packet on signatures using it. Last one adds is here to check
that there is no interaction of l3_proto and ip_proto.

12 years agosig: add l3_proto keyword
Eric Leblond [Fri, 13 Jul 2012 13:46:02 +0000 (15:46 +0200)] 
sig: add l3_proto keyword

This patch adds a l3_proto keyword to the signature language. It
can be used to specify if the signature has to match on IPv4, IPv6
or both. For example, one can write:
  alert http any any -> any 22 (msg: "HTTP v6"; l3_proto:ip6; sid:14;)

This should close #494.

12 years agosig: Add ipv6 and ipv4 to list of protocols
Eric Leblond [Fri, 13 Jul 2012 13:44:31 +0000 (15:44 +0200)] 
sig: Add ipv6 and ipv4 to list of protocols

With this patch it is possible to do:
 alert ipv6 any any -> any any
or
 alert ip4 any any -> any any
to match on IPv4 or IPv6 packets.

12 years agoaf-packet: detect MTU mismatch and warn user
Eric Leblond [Tue, 14 Aug 2012 07:49:07 +0000 (09:49 +0200)] 
af-packet: detect MTU mismatch and warn user

If the MTU on the reception interface and the one on the transmission
interface are different, this will result in an error at transmission
when sending packet to the wire.

12 years agoaf-packet: add optional emergency mode
Eric Leblond [Fri, 27 Jul 2012 09:48:10 +0000 (11:48 +0200)] 
af-packet: add optional emergency mode

Flush all waiting packets to be in sync with kernel when drop
occurs. This mode can be activated by setting use-emergency-flush
to yes in the interface configuration.

12 years agoaf-packet: reorder socket operation.
Eric Leblond [Mon, 30 Jul 2012 10:12:34 +0000 (12:12 +0200)] 
af-packet: reorder socket operation.

This patch moves raw socket binding at the end of init code to
avoid to have a flow of packets reaching the socket before we
start to read them.

The socket creation is now made in the loop function to avoid
any timing issue between init function and the call of the loop.

12 years agoaf-packet: fix runmode name in logging function
Eric Leblond [Fri, 20 Jul 2012 19:11:23 +0000 (21:11 +0200)] 
af-packet: fix runmode name in logging function

12 years agoaf-packet: add doxygen comments
Eric Leblond [Mon, 3 Sep 2012 12:57:44 +0000 (14:57 +0200)] 
af-packet: add doxygen comments

This patch adds doxygen comments to newly introduced function and adds
module AF_PACKET doxygen module with a dedicated AFP peers module.

12 years agoaf-packet: IPS and TAP feature
Eric Leblond [Thu, 19 Jul 2012 18:07:05 +0000 (20:07 +0200)] 
af-packet: IPS and TAP feature

This patch adds a new feature to AF_PACKET capture mode. It is now
possible to use AF_PACKET in IPS and TAP mode: all traffic received
on a interface will be forwarded (at the Ethernet level) to an other
interface. To do so, Suricata create a raw socket and sends the receive
packets to a interface designed in the configuration file.

This patch adds two variables to the configuration of af-packet
interface:
 copy-mode: ips or tap
 copy-iface: eth1 #the interface where packet are copied
If copy-mode is set to ips then the packet wth action DROP are not
copied to the destination interface. If copy-mode is set to tap,
all packets are copied to the destination interface.
Any other value of copy-mode results in the feature to be unused.
There is no default interface for copy-iface and the variable has
to be set for the ids or tap mode to work.

For now, this feature depends of the release data system. This
implies you need to activate the ring mode and zero copy. Basically
use-mmap has to be set to yes.

This patch adds a peering of AF_PACKET sockets from the thread on
one interface to the threads on another interface. Peering is
necessary as if we use an other socket the capture socket receives
all emitted packets. This is made using a new AFPPeer structure to
avoid direct interaction between AFPTreadVars.

There is currently a bug in Linux kernel (prior to 3.6) and it is
not possible to use multiple threads.

You need to setup two interfaces with equality on the threads
variable. copy-mode variable must be set on the two interfaces
and use-mmap must be set to activated.

A valid configuration for an IPS using eth0 and vboxnet1 interfaces
will look like:

af-packet:
  - interface: eth0
    threads: 1
    defrag: yes
    cluster-type: cluster_flow
    cluster-id: 98
    copy-mode: ips
    copy-iface: vboxnet1
    buffer-size: 64535
    use-mmap: yes
  - interface: vboxnet1
    threads: 1
    cluster-id: 97
    defrag: yes
    cluster-type: cluster_flow
    copy-mode: ips
    copy-iface: eth0
    buffer-size: 64535
    use-mmap: yes

12 years agocapture: add data release mechanism
Eric Leblond [Fri, 15 Jun 2012 15:18:57 +0000 (17:18 +0200)] 
capture: add data release mechanism

This patch adds a data release mechanism. If the capture module
has a call to indicate that userland has finished with the data,
it is possible to use this system. The data will then be released
when the treatment of the packet is finished.

To do so the Packet structure has been modified:
+    TmEcode (*ReleaseData)(ThreadVars *, struct Packet_ *);
If ReleaseData is null, the function is called when the treatment
of the Packet is finished.
Thus it is sufficient for the capture module to code a function
wrapping the data release mechanism and to assign it to ReleaseData
field.

This patch also includes an implementation of this mechanism for
AF_PACKET.

12 years agoaf-packet: improve mmaped running mode.
Eric Leblond [Thu, 5 Jul 2012 05:41:16 +0000 (07:41 +0200)] 
af-packet: improve mmaped running mode.

The mmaped mode was using a too small ring buffer size which was
not able to handle burst of packets coming from the network. This
may explain the important packet loss rate observed by Edward
Fjellskål.
This patch increases the default value and adds a ring-size
variable which can be used to manually tune the value.

12 years agoaf-packet: delete design comments
Eric Leblond [Fri, 20 Jul 2012 07:41:52 +0000 (09:41 +0200)] 
af-packet: delete design comments

12 years agoMake sure we never underflow len in DetectLoadSigFile
Victor Julien [Mon, 3 Sep 2012 09:30:19 +0000 (11:30 +0200)] 
Make sure we never underflow len in DetectLoadSigFile

12 years agoAdd counters for IPv4 in IPv6 and IPv6 in IPv6 45/head
Eric Leblond [Mon, 3 Sep 2012 08:04:43 +0000 (10:04 +0200)] 
Add counters for IPv4 in IPv6 and IPv6 in IPv6

12 years agofile: convert filesize to new FileMatch api.
Victor Julien [Thu, 30 Aug 2012 15:17:28 +0000 (17:17 +0200)] 
file: convert filesize to new FileMatch api.

12 years agostream/app layer: call new Truncate callback for data gap case as well.
Victor Julien [Thu, 30 Aug 2012 14:50:16 +0000 (16:50 +0200)] 
stream/app layer: call new Truncate callback for data gap case as well.

12 years agostream/app layer: add Truncate app layer callback that is called if stream depth...
Victor Julien [Thu, 30 Aug 2012 14:44:36 +0000 (16:44 +0200)] 
stream/app layer: add Truncate app layer callback that is called if stream depth is reached. Use it to trunc open files in HTTP.

12 years agofile: implement filesize keyword. #489.
Victor Julien [Thu, 30 Aug 2012 08:02:02 +0000 (10:02 +0200)] 
file: implement filesize keyword. #489.

12 years agodetection engine port api unittests cleanup
Anoop Saldanha [Wed, 29 Aug 2012 09:47:59 +0000 (15:17 +0530)] 
detection engine port api unittests cleanup

12 years agoCreate separate detect API call (FileMatch) for file detection keywords. #531.
Victor Julien [Wed, 29 Aug 2012 08:01:34 +0000 (10:01 +0200)] 
Create separate detect API call (FileMatch) for file detection keywords. #531.

12 years agotls-log: add protocol version to log message. 43/head
Eric Leblond [Tue, 28 Aug 2012 11:24:20 +0000 (13:24 +0200)] 
tls-log: add protocol version to log message.

12 years agofix regression (clobbered register; redmine #534)
pi-rho [Tue, 28 Aug 2012 00:20:58 +0000 (19:20 -0500)] 
fix regression (clobbered register; redmine #534)

12 years agospelling corrections documented in redmine bug#533 40/head
pi-rho [Tue, 28 Aug 2012 00:13:50 +0000 (19:13 -0500)] 
spelling corrections documented in redmine bug#533

12 years agorule reloads: don't lock up main thread so clean shutdown is impossible
Victor Julien [Mon, 27 Aug 2012 15:35:46 +0000 (17:35 +0200)] 
rule reloads: don't lock up main thread so clean shutdown is impossible

12 years agopcap: fix compilation on old libpcap
Victor Julien [Mon, 27 Aug 2012 14:49:58 +0000 (16:49 +0200)] 
pcap: fix compilation on old libpcap

12 years agotm-thread: suppress rarely used variable. 39/head
Eric Leblond [Mon, 27 Aug 2012 13:18:33 +0000 (15:18 +0200)] 
tm-thread: suppress rarely used variable.

12 years agoConvert to atomic and disable check on HTP config change.
Eric Leblond [Wed, 15 Aug 2012 15:28:00 +0000 (17:28 +0200)] 
Convert to atomic and disable check on HTP config change.

This patch converts the series of variable to an atomic.

Furthermore, as the callbacks are now always run, it is not
necessary anymore to refuse a ruleswap if HTP parameters are
changing.

12 years agoGet rid of AppLayerHtpRegisterExtraCallbacks
Eric Leblond [Wed, 15 Aug 2012 12:04:03 +0000 (14:04 +0200)] 
Get rid of AppLayerHtpRegisterExtraCallbacks

This patch add a early exit condition to the body handling callback.
This permits to avoid to avoid a complex system to handle htp
object change.

12 years agoDelay Detect threads initialization
Eric Leblond [Fri, 10 Aug 2012 13:32:30 +0000 (15:32 +0200)] 
Delay Detect threads initialization

This patch modifies the init of Detect threads. They are now started
with a dummy function and their initialisation is done after the
signatures are loaded. Just after this, the dummy function is switched
to normal one.

In IPS mode, this permit to route packets without waiting for the
signature to start and should fix #488.

Offline mode such as pcap file don't use this mode to be sure to
analyse all packets in the file.

The patch introduces a "delayed-detect" configuration variable
under detect-engine. It can be used to activate the feature
(set to "yes" to have signature loaded after capture is started).

12 years agopcap: handle failure of packet treatment
Eric Leblond [Sat, 11 Aug 2012 09:43:18 +0000 (11:43 +0200)] 
pcap: handle failure of packet treatment

If the loop is breaked, this means we've got a treatment error. We
don't need to reconnect but we must exit with correct status.

12 years agotls: suppress always true condition. 34/head
Eric Leblond [Thu, 23 Aug 2012 15:06:39 +0000 (17:06 +0200)] 
tls: suppress always true condition.

12 years agodetect-tls: various indent fixes.
Eric Leblond [Tue, 21 Aug 2012 13:42:10 +0000 (15:42 +0200)] 
detect-tls: various indent fixes.

And delete a useless FIXME.

12 years agotls: store all the certificates chain in the written PEM file.
Eric Leblond [Thu, 23 Aug 2012 07:25:15 +0000 (09:25 +0200)] 
tls: store all the certificates chain in the written PEM file.

When using the tls.store command, a dump of all certificates in
the chain is now done on the disk.