Commit graph

1825 commits

Author SHA1 Message Date
Jon Siwek
f0c713046c Merge branch 'refactor_obj' of https://github.com/MaxKellermann/zeek
Minor formatting/style changes in merge.

* 'refactor_obj' of https://github.com/MaxKellermann/zeek:
  Val: use C++ initializers
  Val: add BroValUnion constructors
  Val: reduce duplicate code by using delegating constructors
  Val: remove unused default constructors and `friend` declarations
  Val: remove the unnecessary BroValUnion typedef
  Type: remove unnecessary enum typedefs
  Type: use C++ initializers
  Type: move code from BroType::BroType() to constexpr functions
  Type: remove useless BroType destructor
  Obj: disallow copying BroObj
  Obj: use C++ initializers
  Obj: make `no_location` constexpr
2020-02-21 20:06:09 -08:00
Jon Siwek
3996a54302 Merge branch 'noreturn' of https://github.com/MaxKellermann/zeek
Minor formatting change in merge so [[noreturn]] is consistently
on same line as function declarations.

* 'noreturn' of https://github.com/MaxKellermann/zeek:
  threading/MsgThread: add [[noreturn]] to InternalError()
  Flare: add [[noreturn]] to bad_pipe_op()
  Obj: add [[noreturn]] attributes to Internal(),  bad_ref()
  Reporter: add [[noreturn]] attribute to several methods
2020-02-21 15:37:33 -08:00
Jon Siwek
38b25cf38d Merge branch 'smart_ptr' of https://github.com/MaxKellermann/zeek
Minor whitespace fixes during merge.

* 'smart_ptr' of https://github.com/MaxKellermann/zeek:
  OpaqueVal: remove misplaced `virtual` keywords
  CompHash: use class IntrusivePtr for the `type` field
  IntrusivePtr: replace the "add_ref" parameter with tag structs
  IntrusivePtr: remove reset(), nobody uses it
  IntrusivePtr: remove ordering operators
  IntrusivePtr: rename detach() to release()
  IntrusivePtr: move nullptr initializer to field declaration
2020-02-21 10:15:24 -08:00
Jon Siwek
678115803b Merge branch 'expr_missing_ref' of https://github.com/MaxKellermann/zeek
Updated the Ref() to happen inline with Assign() call for clarity.

* 'expr_missing_ref' of https://github.com/MaxKellermann/zeek:
  Expr: add missing reference in AssignExpr::InitVal()
2020-02-20 14:59:04 -08:00
Jon Siwek
a20dd12117 Merge branch 'memleaks' of https://github.com/MaxKellermann/zeek
The merge commit fixes reference counting issues introduced with the
changes to ListExpr::Assign() and IndexExpr::Assign(), but then also
several other pre-existing reference counting confusions in other
Assign() implementations/calls, some which were now directly observable
via new crashing behavior, others just from a cursory code audit.

* 'memleaks' of https://github.com/MaxKellermann/zeek:
  input/Manager: fix memory leak in UnrollRecordType()
  OpaqueVal: fix two memory leaks in BloomFilterVal::Merge()
  DbgBreakpoint: fix memory leak
  DebugCmds: fix memory leak
  scan.l: fix crash bug in do_atif()
  Expr: fix memory leak in RecordConstructorExpr::InitVal()
  Expr: fix memory leaks in AssignExpr::EvalIntoAggregate()
  Expr: fix memory leaks in CondExpr::Eval()
  Expr: fix several memory leaks in BoolExpr::Eval()
  Expr: fix various memory leaks in Assign()
  Expr: fix memory leaks in BinaryExpr::Eval()
  analyzer/protocol/http: fix potential memory leak
2020-02-19 18:59:04 -08:00
Jon Siwek
b8497c8245 Merge branch 'dns_memleak' of https://github.com/MaxKellermann/zeek
* 'dns_memleak' of https://github.com/MaxKellermann/zeek:
  analyzer/protocol/dns: fix NSEC3 memory leak
  analyzer/protocol/dns: change runtime check to assert()
  analyzer/protocol/dns: fix memory leak
2020-02-18 12:21:17 -08:00
Jon Siwek
11d8b8c040 Fix code format of various reporter btests 2020-02-14 22:03:11 -08:00
Jon Siwek
e896846752 Update libkqueue for a linux bugfix 2020-02-14 21:15:21 -08:00
Tim Wojtulewicz
47d813badc Merge remote-tracking branch 'MaxKellermann/eliminate_code
* MaxKellermann/eliminate_code:
  RE: make the RE_Matcher destructor non-virtual
  analyzer/protocol/smtp: remove unnecessary nullptr check
  analyzer/Manager: remove unnecessary clear() calls from destructor
  analyzer/protocol/http: remove unnecessary empty destructor
  iosource/pcap/Source: remove unused fields `last_hdr`, `last_data`
  iosource/Manager: eliminate two std::string copies
2020-02-14 16:17:31 -07:00
Jon Siwek
b1e96ab952 Fix various format specifiers 2020-02-14 11:10:41 -08:00
Tim Wojtulewicz
cf8496dc0a Merge remote-tracking branch 'MaxKellermann/includes'
* MaxKellermann/includes:
  broker: include cleanup
  file_analysis: include cleanup
  file_analysis/Analyzer: eliminate duplicate constructor
  probabilistic/Topk: include cleanup
  digest: eliminate the "Reporter.h" include
  Val: eliminate the "RE.h" include
  Val: eliminate the "BroString.h" include
  Val: eliminate the "CompHash.h" include
  Val: forward-declare class PDict, reduce includes
  Val: eliminate the "Scope.h" include
2020-02-14 10:30:13 -07:00
Jon Siwek
a5166086db Merge remote-tracking branch 'origin/topic/timw/dict-unit-tests'
* origin/topic/timw/dict-unit-tests:
  Reset the number of entries in a dict when calling Clear()
  Code cleanup in Dict.h
  Add unit testing for the public Dictionary API
2020-02-13 19:34:29 -08:00
Jon Siwek
33c13c3689 Merge remote-tracking branch 'origin/topic/timw/event-mgr-coverity'
* origin/topic/timw/event-mgr-coverity:
  Check for failure when registering event manager with iosource manager (Coverity 1419398)
2020-02-13 17:15:00 -08:00
Jon Siwek
20eb0e15c7 Updating CHANGES and VERSION. 2020-02-12 00:20:08 -08:00
Jon Siwek
2fb9753cc5 Merge remote-tracking branch 'origin/topic/timw/clang-tidy'
* origin/topic/timw/clang-tidy:
  fixup! Use string_view for a couple of Dbg methods
  Add a couple of missing #includes that clang-tidy complains about (clang-diagnostic-error)
  Fix missing namespace that was causing a build error
  Remove unnecessary const from return value (readability-const-return-type)
  Give real variable names to SegmentProfiler objects when defining them (bugprone-unused-raii)
  Mark a few clang-tidy findings as false-positive
  Use std::move in a few places instead of copying a pass-by-value argument (performance-unnecessary-value-param)
  Use const-references in lots of places (preformance-unnecessary-value-param)
  Use string_view for a couple of Dbg methods
  Use const references over copying variables (performance-unnecessary-copy-initialization, performance-for-range-copy)
  Use single-character version of string find() (performance-faster-string-find)
  Move constructors/operators should be marked noexcept to avoid the compiler picking the copy constructor instead (performance-noexcept-move-constructor)
2020-02-11 23:51:40 -08:00
Jon Siwek
da34c94ae3 Update Broker submodule 2020-02-08 16:20:44 -08:00
Jon Siwek
996b3d523a Update to start of 3.2.0 development 2020-02-08 16:08:01 -08:00
Jon Siwek
0c771ea123 Fix broken links in documentation 2020-02-08 15:48:11 -08:00
Jon Siwek
bb876623af Update submodules to release versions 2020-02-08 12:44:57 -08:00
Jon Siwek
b268b57194 Update embedded CAF to 0.17.4 2020-02-08 09:40:48 -08:00
Jon Siwek
6c72b09bf5 Note new CMake 3.0+ and C++17 requirements in NEWS 2020-02-07 21:11:35 -08:00
Jon Siwek
e50a8848ae Improve an input framework test
A race condition could cause unstable output: if the thread reading the
file is fast, often you see both "pred" functions execute and then both
"line" events execute with both entries already in the table, but if the
thread reading the file is slow, you see pred, event, pred, event, with
only one entry available in the first event.
2020-02-07 20:03:10 -08:00
Jon Siwek
a3b1d202a5 Improve stability of a &expire_func btest
The order in which &expire_func's get called isn't well-defined, so
separate the output from either to ensure diffs against the Baseline are
always consistent.
2020-02-07 15:11:06 -08:00
Tim Wojtulewicz
9754c2c09f Merge remote-tracking branch 'max/optimize'
* max/optimize:
  plugin/Manager: migrate to std::string_view
  util: optimize the normal_path() common case
  util: pass string_view to without_bropath_component()
  module_util: make GLOBAL_MODULE_NAME constexpr
  Scope: convert Scope::Lookup() and others to template
  Scope: Vars() returns const reference
  Anon: remove unnecessary {map,vector}::clear() calls
  Dict: make the destructor non-virtual
  Obj: make the Location constructors `constexpr`
  Obj: remove unused fields Location::{timestamp,text}
  Obj: remove Location::delete_data, nobody ever sets it
  Obj: make the Location destructor non-virtual
2020-02-07 15:26:30 -07:00
Johanna Amann
febfc30c70 Merge remote-tracking branch 'origin/topic/jsiwek/krb-addrs-and-leak'
* origin/topic/jsiwek/krb-addrs-and-leak:
  Improve kerberos analyzer address and event handling
2020-02-07 14:15:44 -08:00
Johanna Amann
56dda98512 Merge remote-tracking branch 'origin/topic/jsiwek/stabilize-ci'
* origin/topic/jsiwek/stabilize-ci:
  Add environment variable to disable supervisor SIGKILL
  Fix a btest's race condition by handling Pcap::file_done
  Add Pcap::file_done event
  Improve btest timeouts
2020-02-07 09:52:57 -08:00
Johanna Amann
a0fea11247 Merge remote-tracking branch 'origin/topic/jsiwek/use-btest-retries'
* origin/topic/jsiwek/use-btest-retries:
  Use 2 btest retries for CI
2020-02-07 09:44:24 -08:00
Johanna Amann
49a21d73d0 Merge remote-tracking branch 'origin/topic/jsiwek/gh-780-indefinite-log-buffer'
* origin/topic/jsiwek/gh-780-indefinite-log-buffer:
  GH-780: Prevent log batches from indefinite buffering
2020-02-07 09:35:29 -08:00
Robin Sommer
a394d2e0d7 Update NEWS to point out Broker wireformat change. 2020-02-07 10:38:25 +00:00
Johanna Amann
391164c9bc Merge remote-tracking branch 'origin/topic/johanna/table-on-change'
* origin/topic/johanna/table-on-change:
  &on_change: Address feedback of Jon.
  &on_change: incooperate feedback of Jon.
  &on_change wrapup: documentation, tests, whitespacing
  Table expiry now raises &on_change handlers
  Prevent recursion of &on_change handlers.
  Make bro_broker::val_to_data take a const Val* instead of a Val
  &on_change: add insertion/change notifications.
  &on_change working for removals from tables.
  Change signature of &on_change handler
  Beginning implementation of &on_change for tables.
2020-02-06 15:01:03 -08:00
Jon Siwek
8e812df6c5 Switch GitHub Action for CI emails to use zeek organization 2020-02-06 13:06:56 -08:00
Jon Siwek
3ee5f5fcaf Update CAF to current 0.17.4 release branch 2020-02-05 21:47:28 -08:00
Jon Siwek
7f76381f13 Remove presumed ownership of HeartbeatTimer
threading::Manager is currently never deleted, but if that ever changes,
deleting the stored HeartbeatTimer pointer would be a double-free
since TimerMgr owns it.
2020-02-05 17:56:02 -08:00
Jon Siwek
c5340c7c3e Merge remote-tracking branch 'origin/topic/timw/773-eventmgr-iosource'
Fixes GH-773

* origin/topic/timw/773-eventmgr-iosource:
  GH-773: Make EventMgr an IOSource so that events interrupt kevent waits
2020-02-05 14:57:26 -08:00
Jon Siwek
0de6bba95e Merge remote-tracking branch 'origin/topic/johanna/692'
* origin/topic/johanna/692:
  Resolve race condition in test
  Change threading formatter errors to warnings.
2020-02-05 10:52:39 -08:00
Tim Wojtulewicz
4a7da2669c Merge remote-tracking branch 'max/include_cleanup'
* max/include_cleanup:
  UID, ..: un-inline methods to reduce header dependencies
  include cleanup
2020-02-04 14:06:05 -07:00
Robin Sommer
532c66df51 Updating submodule.
[nomail]
2020-02-04 11:58:06 +00:00
Tim Wojtulewicz
37e0130461 Merge remote-tracking branch 'origin/topic/jsiwek/consistent-string-view-args'
* origin/topic/jsiwek/consistent-string-view-args:
  Change various functions to by-value std::string_view args
2020-02-03 15:44:28 -07:00
Tim Wojtulewicz
5aa8120259 Merge remote-tracking branch 'origin/topic/jsiwek/pktsrc-options'
* origin/topic/jsiwek/pktsrc-options:
  Change packet source fields of Options to std::optional
2020-02-03 15:42:48 -07:00
Johanna Amann
2129a808f6 Updating CHANGES and VERSION after messing up last commit message. 2020-02-03 13:25:57 -08:00
Jon Siwek
2cda94e8ee Disable Travis leak test
Travis environment doesn't offer enough memory for running ASan very
well, but Cirrus has it covered anyway.
2020-02-03 13:21:32 -08:00
Jon Siwek
d33613c2a5 Merge branch 'master' of https://github.com/ffontaine/zeek
- Also removed the setting of BinPAC_ROOT_DIR in the configure
  script's --with-binpac= option as that breaks the cross-compilation
  use-case

* 'master' of https://github.com/ffontaine/zeek:
  CMakeLists.txt: fix cross-compilation with binpac
2020-02-03 13:05:50 -08:00
Jon Siwek
1e2dd4466c Change requested memory in Cirrus CI config
The ASan build does require quite a bit more, but also the default
release builds should do ok with slightly less.
2020-02-03 10:11:46 -08:00
Jon Siwek
1df5793479 Merge remote-tracking branch 'origin/topic/timw/ioloop-followup'
* origin/topic/timw/ioloop-followup:
  Increase timeout value for live interfaces without file descriptors
  Use ranged-for loops in a few places in iosource Manager
  Change order of includes in iosource Manager, fixes build on FreeBSD 11
2020-02-03 10:04:26 -08:00
Jon Siwek
fa5b3bb91e Merge branch 'no_sscanf' of https://github.com/MaxKellermann/zeek
* 'no_sscanf' of https://github.com/MaxKellermann/zeek:
  util: optimize expand_escape() by avoiding sscanf()
2020-01-31 14:19:12 -08:00
Jon Siwek
d39bb42b14 Merge branch 'optimize_normalize_path' of https://github.com/MaxKellermann/zeek
- Minor changes in merge: extended unit test, prefer emplace_back(),
  remove unused "found" count in new function

* 'optimize_normalize_path' of https://github.com/MaxKellermann/zeek:
  util: add a tokenize_string() overload which returns string_views
  util: store std::string_view in "final_components" vector
  util: use "auto" in normalize_path()
  util: reserve space in normalize_path()
  util: skip "." completely in normalize_path()
  util: pass std::string_view to normalize_path()
  util: pass std::string_view to tokenize_string()
  util: don't modify the input string in tokenize_string()
2020-01-31 13:23:39 -08:00
Jon Siwek
719011cef0 Remove extra fmt() in a reporter->Error() call
Else compiler may warn about format string not being a string literal
2020-01-31 11:25:07 -08:00
Jon Siwek
077fdac332 Merge remote-tracking branch 'origin/topic/timw/264-alternative'
* origin/topic/timw/264-alternative:
  Add better error messaging when RegisterFd/UnregisterFd fail
  Update Supervisor code for the new IOSource API
  Show percentage of packets dropped in the final process output
  Update NEWS and docs submodule
  Remove concept of multiple timer managers
  Test changes caused by minor order-of-operation changes related to the new loop architecture
  Have terminate_processing() raise SIGTERM instead of calling the signal handler directly
  PktSrc iosource changes to match the new IOSource API
  Broker manager changes to match the new IOSource API and loop architecture
  DNS_Mgr changes to match the new IOSource API and loop architecture
  Threading changes for the new loop architecture
  Add Trigger manager for managing triggers created by things like 'when' statements
  Make TimerMgr an IOSource
  Modify IOSource Manager to implement new loop architecture
  Minor amount of code cleanup in Pcap IO source
  IOSource API changes for new loop architecture
  Type and variable usage cleanup in Net.h
  Remove #include of some iosource files from Net.h
  Only allow a single trace file (-r) or interface (-i) option on the command-line
  Remove CQ_TimerMgr in favor of PQ_TimerMgr
2020-01-31 11:04:27 -08:00
Jon Siwek
70b45d1aba Merge remote-tracking branch 'origin/topic/robin/631-deprecation-v2'
During merge I split the test for bro_init/bro_done/bro_script_loaded
event errors into individual tests since the other testing of the zeek
versions of those events seemed fine to otherwise keep.

* origin/topic/robin/631-deprecation-v2:
  Update NEWS for naming changes.
  Small cleanup and updating submodules.
  Remove test for legacy plugin.
  Remove legancy symlinks in aux/.
  Add warnings when loading scripts ending in ".bro", or using legacy environment variables.
  Fix missing rename.
  No longer symlink local.zeek to local.bro.
  Update notice user agent.
  Remove old_comm_usage_is_ok.
  Remove bro-config.h.in and bro-path-dev.in.
  Change Bro wrapper script to now abort when old executable names are still used.
  Remove APIs that were explicitly deprecated to be removed in 3.1.
2020-01-30 19:19:56 -08:00
Tim Wojtulewicz
c5b2659b6b Merge remote-tracking branch 'origin/topic/jsiwek/supervisor-coverity-fixes'
* origin/topic/jsiwek/supervisor-coverity-fixes:
  Fix leaked FDs in redirecting supervised node stdout/stderr
  Add checks for failed fcntl calls
  Set Pipe file descriptor flags correctly
2020-01-30 08:44:59 -07:00