Commit Graph

7693 Commits (suricata-3.2.2)
 

Author SHA1 Message Date
Victor Julien 913071f672 changelog: update for 3.2.2 release 8 years ago
Victor Julien 2c25180d8e pcre: on ppc64 disable only for specific versions
Disable jit only for libpcre 8.39 and 8.40 as those were the buggy
versions.

Thanks to Zoltán Herczeg.
8 years ago
Victor Julien 6c04e055be pcre: disable jit on powerpc64
It appears that both using gcc and clang something gets misoptimised
around pcre's jit. So disable jit for now.
8 years ago
Victor Julien 4a0e4cbbfb luajit: cleanup states before return to pool 8 years ago
Victor Julien 994a2fdb84 lua/streaming: fix http body logging 8 years ago
Jason Ish d6d314aded defrag: (windows) detect more overlaps 8 years ago
Jason Ish 16ca38fc32 defrag: (linux) fix an error in overlapping fragments
If a subsequent fragment has a lower offset than a previous
one and overlaps, trim off the beginning of the previous
fragment.

Based on an issue reported privately.
8 years ago
Jason Ish 7005a77958 defrag: use new unit test macros
Also reformat unit test functions to Suricata style.
8 years ago
Andreas Herz 85e348338b doc: rephrase nocase placement explanation 8 years ago
Eric Leblond 2f01064e84 log-tlsstore: fix error handling
In case of realloc error, the length of the encoding buffer was not
reset and this could result in trying to write to NULL pointer.
8 years ago
Victor Julien 43dee9a5ef unix socket: improve output of unix mode 8 years ago
Jason Ish 840ba2ec9b dns: fix log filtering
Previously only a subset of the records could be selected
in custom. Now allow any to be selected.
8 years ago
Victor Julien 5faa82c5cc modbus: fix compiler warnings about alignment
app-layer-modbus.c:1226:39: warning: taking address of packed member 'transactionId' of class or structure 'ModbusHeader_' may result in an unaligned pointer value [-Waddress-of-packed-member]
    if (ModbusExtractUint16(modbus, &(header->transactionId), input, input_len, &offset)    ||
                                      ^~~~~~~~~~~~~~~~~~~~~
app-layer-modbus.c:1228:39: warning: taking address of packed member 'protocolId' of class or structure 'ModbusHeader_' may result in an unaligned pointer value [-Waddress-of-packed-member]
        ModbusExtractUint16(modbus, &(header->protocolId), input, input_len, &offset)       ||
                                      ^~~~~~~~~~~~~~~~~~
app-layer-modbus.c:1230:39: warning: taking address of packed member 'length' of class or structure 'ModbusHeader_' may result in an unaligned pointer value [-Waddress-of-packed-member]
        ModbusExtractUint16(modbus, &(header->length), input, input_len, &offset)           ||
                                      ^~~~~~~~~~~~~~
3 warnings generated.

Bug #2088
8 years ago
Victor Julien 8890bd1738 pool: fix compiler warning
clang-4.0 reported:

util-pool.c:242:13: warning: logical not is only applied to the left hand side of this bitwise operator [-Wlogical-not-parentheses]
        if (! pb->flags & POOL_BUCKET_PREALLOCATED) {
            ^           ~
util-pool.c:242:13: note: add parentheses after the '!' to evaluate the bitwise operator first
        if (! pb->flags & POOL_BUCKET_PREALLOCATED) {
            ^
              (                                   )
util-pool.c:242:13: note: add parentheses around left hand side expression to silence this warning
        if (! pb->flags & POOL_BUCKET_PREALLOCATED) {
            ^
            (          )
util-pool.c:261:13: warning: logical not is only applied to the left hand side of this bitwise operator [-Wlogical-not-parentheses]
        if (! pb->flags & POOL_BUCKET_PREALLOCATED) {
            ^           ~
util-pool.c:261:13: note: add parentheses after the '!' to evaluate the bitwise operator first
        if (! pb->flags & POOL_BUCKET_PREALLOCATED) {
            ^
              (                                   )
util-pool.c:261:13: note: add parentheses around left hand side expression to silence this warning
        if (! pb->flags & POOL_BUCKET_PREALLOCATED) {
            ^
            (          )
2 warnings generated.
8 years ago
Victor Julien 53709614b8 af-packet: fix cppcheck false positive
[src/source-af-packet.c:1903]: (error) Resource leak: fd
8 years ago
Victor Julien fb9a554fdb bug 2113: unix-socket start up race 8 years ago
Victor Julien 5a812400fb flow-worker: clean up thread init 9 years ago
Jason Ish 4cf5a07875 autoconf - look for stdbool.h 9 years ago
Victor Julien 976ad807be http: fix body tracking corner case
In some cases, observed with inspect limits 0, the body tracking could
get confused. When all chunks were already freed, a new chunk would
be considered to be the start of the body. This would overwrite the
bodies 'content_len_so_far' tracker, instead of adding to it. This in
turn could lead to a assertion abort in the inspection code.

This patch redoes the append code to always add the current lenght. It
cleans up the code to remove redundant logic.

Issue: https://redmine.openinfosecfoundation.org/issues/2078
Reported-By: Jørgen Bøhnsdalen
9 years ago
Alexander Gozman 3d3d2928fa af-packet: fix parsing packet in TPACKET_V3 mode
AFPParsePacketV3() saved tpacket_block_desc structure
instead of tpacket3_hdr. As a result, reconstructed
packets were wrong.

Bug #2047.
9 years ago
Alexander Gozman 6f8af69c88 af-packet: get VLAN info for packets in TPACKET_V3 mode 9 years ago
Alexander Gozman 8fb72c60f4 af-packet: write VLAN info for both TPACKET_V2 and V3 9 years ago
Jason Ish 00c6b7e44d defrag: fix argument used in macro to match signature
"p" was being used in the macro but was not an argument to
the macro, but it worked due to the context of the macro.

Use the actual macro argument, d2, instead of p.

Results in no change to generated code.
9 years ago
Jon Zeolla 598a7187c3 docs: fix statement about flow:to_server 9 years ago
Jon Zeolla 528721fd12 docs: clarify how iprep works 9 years ago
Victor Julien 1ffefad075 detect: fix ssl_state test 9 years ago
Victor Julien d92e3091a7 bytejump: don't print errors when matching
When bytejump was told to convert some payload data to int from a
string it would print an error to the screen if the conversion
failed. This is unwanted as the payload is controlled by an attacker
and printing is expensive.
9 years ago
Victor Julien 68652f302f app-layer: fix gap handling in protocol detection
A GAP during protocol detection would lead to all reassembly
getting disabled, so also the raw reassembly. In addition, it
could prevent the opposing side from doing protocol detection.

This patch remove the 'disable reassembly' logic. Stream engine
will take the stream with GAP and app-layer will make the proto
detection as complete.
9 years ago
Victor Julien 7bdc28cae9 file store: store multiple files if available 9 years ago
Victor Julien 5555b89b47 app-layer: fix memleak on bad traffic
If state was alloc'd after protocol detection, but then the direction
turned out to be wrong, the state would not be freed.
9 years ago
Victor Julien 0a3aa9983f ippair: fix xbits unset memleak 9 years ago
Victor Julien 43b1e53837 ippair: use both addresses in hash 9 years ago
Victor Julien e17bc4b784 stream: validate SACK right edge to be in window 9 years ago
Jason Ish e42d355f80 ipv4: update checksum function to be like tcp/udp
Update the IPv4 checksum function to be like the
changed TCP/UDP checksum functions for consistency.
9 years ago
Jason Ish fe780dd93c tcp/udp: rename checksum functions for better meaning
The TCP/UDP checksum functions no longer just calculate
the checksum, they can validate as well as calculate so
use a more generic name.
9 years ago
Jason Ish 62c9d0b140 tcp/udp: fix checksum validation when 0xffff
Issue:
https://redmine.openinfosecfoundation.org/issues/2041

One approach to fixing this issue to just validate the
checksum instead of regenerating it and comparing it. This
method is used in some kernels and other network tools.

When validating, the current checksum is passed in as an
initial argument which will cause the final checksum to be 0
if OK. If generating a checksum, 0 is passed and the result
is the generated checksum.
9 years ago
Victor Julien cf36cdfd8a qa/appveyor: install libiconv-devel 9 years ago
Jason Ish c270530706 travis: macos: unlink all deps, then relink
Kind of ugly, but first unlink all dependencies then install.
The deps that don't get an upgrade will remain unlinked, so
relink all dependencies as relinking an already linked dep
does not error out.
9 years ago
Victor Julien 38addf3e2a travis: fix pkg-config in mac builds
Unlink pkg-config before installing.
9 years ago
Jason Ish d598284e20 travis: fix libpcre in mac builds
It looks like Travis changed their Mac image and pcre is now
installed by default. In case it gets removed again, just unlink
it before re-installing so it doesn't fail on install.
9 years ago
Jason Ish f0b2cb49c6 Makefile: fix race condition in make install-full
Use recursive make for the install process so it
is executed in a predictable order.

Addresses issue:
https://redmine.openinfosecfoundation.org/issues/1470
which triggered on OSX/macOS.
9 years ago
Victor Julien e072a10f64 changelog: update for 3.2.1 release 9 years ago
Victor Julien 71710f088e dns: fix outputs with 0-len A/AAAA records 9 years ago
Victor Julien 20990f7a7e dns: fix out of bounds read
On a zero size A or AAAA record, 4 or 16 bytes would still be
read.

Found with AFL+ASAN.
9 years ago
Jason Ish 4a04f814b1 defrag - take protocol into account during re-assembly
The IP protocol was not being used to match fragments with
their packets allowing a carefully constructed packet
with a different protocol to be matched, allowing re-assembly
to complete, creating a packet that would not be re-assembled
by the destination host.
9 years ago
Victor Julien 292baf0872 afl: add ethernet and erspan entry points 9 years ago
Victor Julien 49c41fc79e afl: clean up commandline parsing 9 years ago
Victor Julien b56b04f84c afl: pass a packet queue to decoder calls 9 years ago
Jason Ish 35488eefda afl: set the packet data so pktlen gets set 9 years ago
Victor Julien 322c260749 afl: minimalistic script to start AFL fuzzers
in suricata source dir:

mkdir afl
cd afl
bash ../scripts/afl/runafl.sh decoder-ipv4
9 years ago