]>
git.ipfire.org Git - thirdparty/suricata.git/log
Victor Julien [Wed, 11 Jan 2017 14:36:15 +0000 (15:36 +0100)]
address parsing: fix memory leak in error path
Victor Julien [Wed, 11 Jan 2017 14:32:45 +0000 (15:32 +0100)]
ssl: suppress scan-build warnings
Victor Julien [Wed, 11 Jan 2017 14:20:25 +0000 (15:20 +0100)]
output: clean up output function
Don't allocate memory per call.
Victor Julien [Wed, 11 Jan 2017 13:55:34 +0000 (14:55 +0100)]
smb/dcerpc: suppress scan-build warnings
Victor Julien [Wed, 11 Jan 2017 13:55:13 +0000 (14:55 +0100)]
ac-bs: fix scan-build warnings
Victor Julien [Wed, 11 Jan 2017 13:34:41 +0000 (14:34 +0100)]
queue: add debug assertions to TAILQ
To avoid scan-build fp's add assertions that are only active if
built with scan-build.
Travis Green [Wed, 21 Dec 2016 15:56:15 +0000 (08:56 -0700)]
yaml: update commented rule files
Disabled scada.rules, added commented rule file names to help
administrators find informational rule files.
Mats Klepsland [Thu, 22 Dec 2016 07:38:46 +0000 (08:38 +0100)]
tls-store: fix bug that causes Suricata to crash
Fix bug that causes Suricata to crash when the tls.store keyword is used.
*** Error in `/usr/bin/suricata': free(): invalid next size (fast):
0x00007fd4b4373180 ***
Jason Ish [Mon, 16 Jan 2017 16:44:19 +0000 (10:44 -0600)]
proto detect - fix coverity CID
1204325
CID
1204325 (#1 of 1): Logically dead code (DEADCODE)
dead_error_line: Execution cannot reach this statement: mask = 0U;.
433 mask = 0;
additionally, mask is initialized to 0
Jason Ish [Mon, 16 Jan 2017 16:38:08 +0000 (10:38 -0600)]
template logger - fix coverity CID
1324964
null: At condition templatejs != NULL, the value of templatejs must be
NULL.
dead_error_condition: The condition templatejs != NULL cannot be true.
113 if (templatejs != NULL) {
CID
1324964 (#1 of 1): Logically dead code (DEADCODE)
dead_error_line: Execution cannot reach this statement:
json_decref(templatejs);.
114 json_decref(templatejs);
115 }
Jason Ish [Mon, 16 Jan 2017 16:34:19 +0000 (10:34 -0600)]
dns (tcp) - fix coverity CIDs
1374306 ,
1374305
CID
1374306 (#1 of 1): Dereference before null check (REVERSE_INULL)
check_after_deref: Null-checking dns_state suggests that it may be null,
but it has already been dereferenced on all paths leading to the check.
585 if (dns_state != NULL && f != NULL) {
586 dns_state->last_req = f->lastts;
587 }
CID
1374305 (#1 of 1): Dereference before null check (REVERSE_INULL)
check_after_deref: Null-checking dns_state suggests that it may be null,
but it has already been dereferenced on all paths leading to the check.
366 if (dns_state != NULL && f != NULL) {
367 dns_state->last_req = f->lastts;
368 }
Jason Ish [Mon, 16 Jan 2017 16:31:01 +0000 (10:31 -0600)]
dns (tcp) - fix coverity cid
1374307
CID
1374307 (#1 of 1): Dereference before null check (REVERSE_INULL)
check_after_deref: Null-checking dns_state suggests that it may be null,
but it has already been dereferenced on all paths leading to the check.
317 if (dns_state != NULL && f != NULL) {
318 dns_state->last_resp = f->lastts;
319 }
Eric Leblond [Tue, 10 Jan 2017 22:46:48 +0000 (14:46 -0800)]
detect-parse: simplify port prefiltering
Regular expression was not matching some authorized setting like
"![1234, 1235]". This patch simplify the regexp to match on
possible character and let the port parsing code handle the
complete verification.
Jason Ish [Mon, 9 Jan 2017 21:13:16 +0000 (15:13 -0600)]
dns: increment tx id when allocated during response
Victor Julien [Mon, 16 Jan 2017 15:00:25 +0000 (16:00 +0100)]
common: improve BUG_ON
When BUG_ON is a wrapper for assert(), we risk getting rid of certain
code lines. Assert is a no-op when NDEBUG is defined.
This patch defines an alternate path for BUG_ON that exits after
printing an error.
Bug #2003.
Andreas Herz [Fri, 13 Jan 2017 22:44:57 +0000 (23:44 +0100)]
decode-icmpv6: add missing types
There have been some ICMPv6 types missing within the DecodeICMPV6 that
are added by this commit and the code check is adjusted to always use
the DEFINE.
Jason Ish [Tue, 20 Dec 2016 21:37:33 +0000 (15:37 -0600)]
dns (tcp): register a to_client (response) probing parser
Just a minimal parser to make sure the data contains at
least a header.
Jason Ish [Tue, 20 Dec 2016 20:50:58 +0000 (14:50 -0600)]
app-layer: support to server and to client probing parsers
When registering a probing parser allow to_server and
to_client parsers to be registered. Previously the
probing parser may be called for both directions which
in some cases works OK, but in others can cause
the to_client side to be detected as failed.
Victor Julien [Tue, 22 Nov 2016 20:46:20 +0000 (21:46 +0100)]
redis: support for all output types
Victor Julien [Tue, 22 Nov 2016 17:04:29 +0000 (18:04 +0100)]
redis: use 'binary' notation for output
Victor Julien [Thu, 15 Dec 2016 15:17:33 +0000 (16:17 +0100)]
common: add WARN_UNUSED macro
Victor Julien [Wed, 14 Dec 2016 13:24:44 +0000 (14:24 +0100)]
detect: remove dead code
Eric Leblond [Tue, 20 Dec 2016 09:43:07 +0000 (10:43 +0100)]
util-magic: fix build when magic is not available
If HAVE_MAGIC is not defined then we don't have the test functions
so we can't register them.
Victor Julien [Fri, 14 Oct 2016 15:29:54 +0000 (17:29 +0200)]
doc: initial xbits documentation
Victor Julien [Thu, 13 Oct 2016 10:42:17 +0000 (12:42 +0200)]
xbits: clean up parsing and tests
Jason Ish [Mon, 19 Dec 2016 15:11:48 +0000 (09:11 -0600)]
pcap-log: fix memory leak during initialization of ring buffer
A free was missing when files are removed during initialization
of the ring buffer.
Redmine issue:
https://redmine.openinfosecfoundation.org/issues/1985
Eric Leblond [Wed, 14 Dec 2016 17:01:09 +0000 (18:01 +0100)]
smtp: commands and replies are not case sensitive
RFC states that "Commands and replies are not case sensitive" and
patterns were registered to be case sensitive. So this patch fixes
a trivial evasion of SMTP signatures.
Mats Klepsland [Fri, 16 Dec 2016 13:43:43 +0000 (14:43 +0100)]
tls: fix tls_cert_subject prefilter bug
If check in prefilter was checking that issuer was non-NULL, when
it in fact should be checking subject.
Mats Klepsland [Fri, 16 Dec 2016 12:04:03 +0000 (13:04 +0100)]
tls: increase max number of tls records per packet
Tls packets may contain several records. This increase the number
of allowed records per packet from 30 to 255, and adds a new and
more informative decoder event when this limit is reached.
Mats Klepsland [Tue, 13 Dec 2016 13:56:26 +0000 (14:56 +0100)]
tls: don't trigger decoder event on no extensions in CLIENT_HELLO
No extensions are allowed in <TLSv.1.2, so don't trigger SURICATA
TLS handshake invalid length decoder event when no extensions are
specified in CLIENT HELLO.
Victor Julien [Sun, 13 Nov 2016 13:36:25 +0000 (08:36 -0500)]
magic: make optional
Make libmagic optional. If installed it will be enabled by default in
configure. Use --disable-libmagic to disable.
Jason Ish [Thu, 15 Dec 2016 18:36:25 +0000 (12:36 -0600)]
log-pcap: use a snaplen of 262144 instead of -1.
Newer versions of libpcap will not open pcap files with a
snaplen of -1, instead use the current maximum value of
262144.
Issue:
https://redmine.openinfosecfoundation.org/issues/1987
Victor Julien [Sun, 4 Dec 2016 10:10:18 +0000 (11:10 +0100)]
doc: DNP3 support is now available
Victor Julien [Fri, 16 Dec 2016 11:11:18 +0000 (12:11 +0100)]
hostbits/xbits: free hostbit
Fix memory leak. Hostbits were not actually freed.
Bug #1975.
Victor Julien [Tue, 13 Dec 2016 09:23:21 +0000 (10:23 +0100)]
http: allow lower/mixed case in proto detect
In HTTP detection registered patterns were upper case only. Since the
detection is based on both sides this would still work for sessions
where one of the talkers misbehaved. If both sides misbehave this
would fail however, so this patch introduces case insensive matching.
Jason Ish [Tue, 29 Nov 2016 17:03:03 +0000 (11:03 -0600)]
travis: use a build matrix and add additional builds
The following builds were added:
- linux, clang with -Wshadow
- linux w/ profiling
- linux w/ debug
- linux w/ no-json support
Removes the extra OS X build.
Travis file was reworked signficantly for readabilty.
Jason Ish [Tue, 29 Nov 2016 16:45:02 +0000 (10:45 -0600)]
profiling: fix shadow error
Local variable store was shadowing variable in function
definition.
Victor Julien [Fri, 2 Dec 2016 09:10:20 +0000 (10:10 +0100)]
unix-socket: clean up path handling
Create/check socket path in a single place. Don't use dynamic
memory allocation.
Victor Julien [Thu, 1 Dec 2016 14:19:35 +0000 (15:19 +0100)]
unix-socket: create socket directory if possible
Create the socket directory in the default case.
Since we're doing stat+mkdir indicate to Coverity not to worry about
the toctou case.
Victor Julien [Thu, 1 Dec 2016 14:06:57 +0000 (15:06 +0100)]
unix-socket: be more specific about problems
Victor Julien [Thu, 1 Dec 2016 13:54:04 +0000 (14:54 +0100)]
unix-socket: don't error out on unix socket failure
If --init-errors-fatal is specified do error out.
Bug https://redmine.openinfosecfoundation.org/issues/1973
Victor Julien [Tue, 29 Nov 2016 17:15:42 +0000 (18:15 +0100)]
Update Changelog for 3.2 release
Jason Ish [Tue, 29 Nov 2016 13:57:02 +0000 (07:57 -0600)]
dnp3: use _ in keyword names instead of "."
dnp3.ind -> dnp3_ind
dnp3.func -> dnp3_func
dnp3.obj -> dnp3_obj
The variations with a "." are now aliases.
Victor Julien [Fri, 7 Oct 2016 11:49:40 +0000 (13:49 +0200)]
af-packet: fix fanout support on Debian Jessie
Debian Jessie with kernel 3.16 would not accept the 'id' of 99 used
in the test. Id 1 does work.
Alexander Gozman [Wed, 12 Oct 2016 08:12:34 +0000 (11:12 +0300)]
Fix port parsing in config file, added one more corresponding test.
Some examples from wiki caused parsing errors.
For example, "[1:80,![2,4]]" was treated as a mistake.
Also fixed loop detection in variables declaration. For example,
'A: "HOME_NET, !$HOME_NET"' resulted in parsing error.
Victor Julien [Tue, 29 Nov 2016 08:29:17 +0000 (09:29 +0100)]
qa: only run cocci tests on one linux builder
Jason Ish [Mon, 28 Nov 2016 16:23:34 +0000 (10:23 -0600)]
travis: macos support
Jason Ish [Mon, 28 Nov 2016 18:19:52 +0000 (12:19 -0600)]
unittest-helper: fix format string compiler warnings
Jason Ish [Mon, 28 Nov 2016 18:19:13 +0000 (12:19 -0600)]
detect-stream_size: fix format string compiler warnings
Jason Ish [Mon, 28 Nov 2016 18:18:47 +0000 (12:18 -0600)]
stream-tcp: fix format string compiler warnings
Jason Ish [Mon, 28 Nov 2016 18:18:23 +0000 (12:18 -0600)]
modbus: fix format string compiler warnings
Jason Ish [Mon, 28 Nov 2016 16:07:41 +0000 (10:07 -0600)]
dnp3: rename "index" variables to "point_index"
Gcc 4.6 will warning with -Wshadow for a local variable
named "index" as <strings.h> has a function named "index".
Newer versions of gcc handle this case.
Jason Ish [Mon, 28 Nov 2016 16:06:14 +0000 (10:06 -0600)]
dnp3-gen: rename index variable to point_index
Gcc 4.6 will warning with -Wshadow for a local variable
named "index" as <strings.h> has a function named "index".
Newer versions of gcc handle this case.
Victor Julien [Mon, 28 Nov 2016 13:40:20 +0000 (14:40 +0100)]
qa: add -Wshadow to appveyor builds
Victor Julien [Mon, 28 Nov 2016 12:03:34 +0000 (13:03 +0100)]
proto detect: fix -Wshadow warning
Victor Julien [Mon, 28 Nov 2016 11:54:16 +0000 (12:54 +0100)]
dcerpc: fix -Wshadow warnings
Victor Julien [Mon, 28 Nov 2016 11:51:52 +0000 (12:51 +0100)]
commandline: fix -Wshadow warnings
Victor Julien [Mon, 28 Nov 2016 11:36:41 +0000 (12:36 +0100)]
detect-address: fix -Wshadow warnings
Victor Julien [Mon, 28 Nov 2016 11:36:26 +0000 (12:36 +0100)]
asn1: fix -Wshadow warnings
Victor Julien [Mon, 28 Nov 2016 11:24:35 +0000 (12:24 +0100)]
asn1: modernize test
Victor Julien [Mon, 28 Nov 2016 11:24:19 +0000 (12:24 +0100)]
yaml: fix tests for -Wshadow
Victor Julien [Mon, 28 Nov 2016 11:24:03 +0000 (12:24 +0100)]
dnp3: fix test for -Wshadow
Victor Julien [Mon, 28 Nov 2016 09:29:25 +0000 (10:29 +0100)]
runmodes: fix -Wshadow warnings
Victor Julien [Mon, 28 Nov 2016 09:27:34 +0000 (10:27 +0100)]
mpm ac-bs: fix -Wshadow warnings
Victor Julien [Mon, 28 Nov 2016 09:27:18 +0000 (10:27 +0100)]
threads: fix -Wshadow warnings
Victor Julien [Mon, 28 Nov 2016 09:21:53 +0000 (10:21 +0100)]
commandline: fix -Wshadow warnings
Victor Julien [Mon, 28 Nov 2016 09:18:03 +0000 (10:18 +0100)]
nfq: fix -Wshadow warnings
Rename globals to make sure it's clear they are globals.
Victor Julien [Mon, 28 Nov 2016 09:11:44 +0000 (10:11 +0100)]
reputation: fix -Wshadow warnings
Victor Julien [Mon, 28 Nov 2016 09:10:40 +0000 (10:10 +0100)]
eve-flow: fix -Wshadow warning
Victor Julien [Mon, 28 Nov 2016 09:09:16 +0000 (10:09 +0100)]
eve-file: fix -Wshadow warnings
Victor Julien [Mon, 28 Nov 2016 09:07:39 +0000 (10:07 +0100)]
ippair: fix -Wshadow warning
Victor Julien [Mon, 28 Nov 2016 09:07:25 +0000 (10:07 +0100)]
host: fix -Wshadow warning
Victor Julien [Mon, 28 Nov 2016 09:07:09 +0000 (10:07 +0100)]
flow: fix -Wshadow warning
Victor Julien [Mon, 28 Nov 2016 09:06:42 +0000 (10:06 +0100)]
within: fix -Wshadow warning
Victor Julien [Mon, 28 Nov 2016 09:05:51 +0000 (10:05 +0100)]
prefilter: fix -Wshadow warnings
Victor Julien [Mon, 28 Nov 2016 09:04:25 +0000 (10:04 +0100)]
detect: fix -Wshadow warning
Victor Julien [Mon, 28 Nov 2016 09:03:11 +0000 (10:03 +0100)]
app engines: fix -Wshadow warning
Victor Julien [Mon, 28 Nov 2016 09:01:52 +0000 (10:01 +0100)]
address: fix -Wshadow warning
Victor Julien [Mon, 28 Nov 2016 09:00:35 +0000 (10:00 +0100)]
distance: fix -Wshadow warning
Victor Julien [Mon, 28 Nov 2016 08:59:05 +0000 (09:59 +0100)]
content: fix -Wshadow warning
Victor Julien [Mon, 28 Nov 2016 08:58:44 +0000 (09:58 +0100)]
mem: fix SCStrdup -Wshadow warning
Victor Julien [Mon, 28 Nov 2016 08:55:17 +0000 (09:55 +0100)]
dns: fix -Wshadow warnings
Victor Julien [Mon, 28 Nov 2016 08:48:22 +0000 (09:48 +0100)]
app-layer-proto-detect: fix -Wshadow warning
Victor Julien [Mon, 28 Nov 2016 08:44:23 +0000 (09:44 +0100)]
dnp3: fix coverity CID
1374300
Victor Julien [Mon, 28 Nov 2016 12:53:57 +0000 (13:53 +0100)]
flow: suppress coverity CID 400600
Victor Julien [Mon, 28 Nov 2016 08:39:02 +0000 (09:39 +0100)]
stat: suppress CID
1293508 and
1312013
Victor Julien [Mon, 28 Nov 2016 08:34:43 +0000 (09:34 +0100)]
nfq: suppress CID
1374302 and
1374303
Victor Julien [Mon, 28 Nov 2016 08:20:01 +0000 (09:20 +0100)]
host-info: coverity
1298890
Victor Julien [Mon, 28 Nov 2016 08:16:05 +0000 (09:16 +0100)]
ttl: coverity 400560 + minor cleanups
Victor Julien [Mon, 28 Nov 2016 08:12:23 +0000 (09:12 +0100)]
tos: coverity 400559
Victor Julien [Mon, 28 Nov 2016 08:11:42 +0000 (09:11 +0100)]
ssl-state: coverity 400558
Jason Ish [Thu, 24 Nov 2016 17:21:48 +0000 (11:21 -0600)]
issue 1961: depth: fail if numeric value has trailing text
Catches the case where the depth is not terminated with a
semicolon (eg: "depth:17 classtype:trojan-activity") which
is usually a sign the rule has a missing semi-colon.
Jason Ish [Thu, 24 Nov 2016 16:59:15 +0000 (10:59 -0600)]
log-pcap.c: cleanup scan-build warning
Don't initialize value to a value that is never used.
Jason Ish [Thu, 24 Nov 2016 16:36:27 +0000 (10:36 -0600)]
log-pcap.c: fix resource leak found by coverity
Goto the failure label instead of returning which will allow the open
directory to get cleaned up.
Fixes:
*** CID
1394675 : Resource leaks (RESOURCE_LEAK)
/src/log-pcap.c: 615 in PcapLogInitRingBuffer()
609 * failure as the file might just not be a pcap log file. */
610 continue;
611 }
612
613 PcapFileName *pf = SCCalloc(sizeof(*pf), 1);
614 if (unlikely(pf == NULL)) {
>>> CID
1394675 : Resource leaks (RESOURCE_LEAK)
>>> Variable "dir" going out of scope leaks the storage it points to.
615 return TM_ECODE_FAILED;
616 }
617 char path[PATH_MAX];
618 snprintf(path, PATH_MAX - 1, "%s/%s", pattern, entry->d_name);
619 if ((pf->filename = SCStrdup(path)) == NULL) {
620 goto fail;
This also means that pf can be NULL which should clear up CID
1394676 (REVERSE_INULL).
Jason Ish [Wed, 23 Nov 2016 21:59:28 +0000 (15:59 -0600)]
doc: document that that ;, \, " need to be escaped in rules
Victor Julien [Wed, 23 Nov 2016 14:27:28 +0000 (15:27 +0100)]
qa: appveyor support
Victor Julien [Thu, 24 Nov 2016 12:31:05 +0000 (13:31 +0100)]
qa: update url in libhtp script
Jason Ish [Sat, 24 Sep 2016 02:46:06 +0000 (20:46 -0600)]
pcap-log: seed ring buffer on start up
On start, look for existing pcap log files and add them to
the ring buffer. This makes pcap-log self maintaining over
restarts removing the need for external tools to clear
orphaned files.
Eric Leblond [Wed, 9 Nov 2016 19:08:07 +0000 (14:08 -0500)]
documentation: fix list keywords URLs
Update URLs in keyword definition to point to sphinx documentation.
Jason Ish [Tue, 8 Nov 2016 17:02:23 +0000 (12:02 -0500)]
logging: hook the application log file into rotation