Commit Graph

7746 Commits (5bafc64c089daaa1d642d8765da5e1eada14641e)
 

Author SHA1 Message Date
Victor Julien cb36dee477 hyperscan: fix minor coverity issue in error path
*** CID 1398951:  API usage errors  (LOCK)
/src/util-mpm-hs.c: 722 in SCHSPreparePatterns()
716         SCMutexUnlock(&g_db_table_mutex);
717
718         SCHSFreeCompileData(cd);
719         return 0;
720
721     error:
>>>     CID 1398951:  API usage errors  (LOCK)
>>>     "pthread_mutex_unlock" unlocks "g_db_table_mutex" while it is unlocked.
722         SCMutexUnlock(&g_db_table_mutex);
723         if (pd) {
724             PatternDatabaseFree(pd);
725         }
726         if (cd) {
8 years ago
Victor Julien 15f4144eda smb: add tcp/445 to proto detect fallback 8 years ago
Victor Julien fa8cbd8741 smb: detect protocol in both directions 8 years ago
Jason Ish e9fccfa67c tx logging: only update logged tx id if all loggers logged
Prevents the case where the logged id is incremented if a newer
transaction is complete and an older one is still outstanding.

For example, dns request0, unsolicited dns response, dns response0

would result in the valid response0 never being logged.

Similarily this could happen for:
  request0, request1, response1, response0

which would end up having request0, request1 and response1 logged,
but response0 would not be logged.
8 years ago
Eric Leblond 0d5fd0f658 util-file: fix error logic in hash computation
This patch fixes an issue with hash computation resulting in the
invalidity of at least one hash when at least two different hashes
functions were used.

Impact was setting as `force-hash: [md5, sha256]` not to be valid.
Also it could lead to false negative if too different hash functions
had to be used on a single file due to signatures.
8 years ago
Jason Ish 20111cab23 unix-socket: fix shadowed variable
ret does not need to be redefined here, the existing
declaration of ret can be used.
8 years ago
Jason Ish 3e70d7befc travis: export CFLAGS on linux 8 years ago
Jason Ish f180ed8715 travis: add a build with -DNDEBUG 8 years ago
Victor Julien f964cdbc93 address parsing: fix memory leak in error path 8 years ago
Victor Julien a6fccd952e ssl: suppress scan-build warnings 8 years ago
Victor Julien 61b72c6981 output: clean up output function
Don't allocate memory per call.
8 years ago
Victor Julien 709d20f8c6 smb/dcerpc: suppress scan-build warnings 8 years ago
Victor Julien 618ab4e177 ac-bs: fix scan-build warnings 8 years ago
Victor Julien bbc02205fb queue: add debug assertions to TAILQ
To avoid scan-build fp's add assertions that are only active if
built with scan-build.
8 years ago
Travis Green f08cc1f3db yaml: update commented rule files
Disabled scada.rules, added commented rule file names to help
administrators find informational rule files.
8 years ago
Mats Klepsland 03ad9d4ec0 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 ***
8 years ago
Jason Ish 87b5bf9541 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
8 years ago
Jason Ish d09cd16c8c 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    }
8 years ago
Jason Ish a10a9220cf 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    }
8 years ago
Jason Ish dfbfb50f64 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    }
8 years ago
Eric Leblond 5b1de57d73 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.
8 years ago
Jason Ish b0de5ad1a8 dns: increment tx id when allocated during response 8 years ago
Victor Julien fe4e119278 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.
8 years ago
Andreas Herz 98e8b13bf0 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.
8 years ago
Jason Ish bcdbd12839 dns (tcp): register a to_client (response) probing parser
Just a minimal parser to make sure the data contains at
least a header.
8 years ago
Jason Ish c35c18a797 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.
8 years ago
Victor Julien 586774203f redis: support for all output types 8 years ago
Victor Julien 2820ed332e redis: use 'binary' notation for output 8 years ago
Victor Julien df28c1ac6e common: add WARN_UNUSED macro 8 years ago
Victor Julien 8c65d45d55 detect: remove dead code 8 years ago
Eric Leblond 63a3b84127 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.
8 years ago
Victor Julien bc38cd5932 doc: initial xbits documentation 8 years ago
Victor Julien cb08f02140 xbits: clean up parsing and tests 8 years ago
Jason Ish 27ec811187 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
8 years ago
Eric Leblond 9f6b58747b 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.
8 years ago
Mats Klepsland ffcb4ad232 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.
8 years ago
Mats Klepsland 10c93221fa 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.
8 years ago
Mats Klepsland 554065189c 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.
8 years ago
Victor Julien 810e43f373 magic: make optional
Make libmagic optional. If installed it will be enabled by default in
configure. Use --disable-libmagic to disable.
8 years ago
Jason Ish 79a3c6c7b1 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
8 years ago
Victor Julien 41074a87a0 doc: DNP3 support is now available 8 years ago
Victor Julien a44b612a41 hostbits/xbits: free hostbit
Fix memory leak. Hostbits were not actually freed.

Bug #1975.
8 years ago
Victor Julien 579d6d3ff7 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.
8 years ago
Jason Ish 94bc7e5f5f 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.
8 years ago
Jason Ish 92885d6960 profiling: fix shadow error
Local variable store was shadowing variable in function
definition.
8 years ago
Victor Julien abbc0f76eb unix-socket: clean up path handling
Create/check socket path in a single place. Don't use dynamic
memory allocation.
8 years ago
Victor Julien c5e550b10d 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.
8 years ago
Victor Julien 3f741e450b unix-socket: be more specific about problems 8 years ago
Victor Julien 9368013645 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
8 years ago
Victor Julien 7db3172479 Update Changelog for 3.2 release 8 years ago