Commit graph

13262 commits

Author SHA1 Message Date
Tim Wojtulewicz
1941fd80f2 Disable object-size analysis if optimization set to -O0 2022-04-14 08:59:05 -07:00
Robin Sommer
445903f808
Add tests exercising dictionary iteration during modification.
These are some of the reproducers from #2017 and #2032 by Arne Welzel.
2022-04-14 11:12:11 +02:00
Robin Sommer
09b132728c
Fix another crash during dictionary iteration.
Closes #2017.
2022-04-14 11:11:57 +02:00
Robin Sommer
6491db6617
Fix assertions in dictionary that can trigger for benign reasons.
These assertions were checking for a situation that I believe can
happen legitimately: a robust iterator pointing to an index that,
after some table resizing, happens to be inside the overflow area and
hence empty. We'll now move it to the end of the table in the case.
2022-04-14 11:11:03 +02:00
Robin Sommer
b4f52ff311
Fix robust iterators when modifying dictionary during iteration.
When inserting/deleting elements, we now remove their `DictEntries`
from any robust iterators' bookkeeping. First, we don't need that
information anymore, and second the `DictEntries` contain pointers
that may become invalid.

I don't know how to write a unit test for this unfortunately because
it depends on where exactly things land in the hash table.

Btw, memory mgmt for DictEntries is pretty fragile: They contain
pointers to both memory they own (`key`) and memory they don't own
(`value`). The former type of pointers is shallow-copied on
assignment/copy-construction, meaning that there can be multiple
instances seemingly owning the same memory. That only works because
deletion is manual, and not part of standard destruction. The second
type of pointer has a similar problem, except that it's managed
externally. It's important to not end up with multiple `DictEntries`
pointing to the same value (which is actually what that iterator
bookkeeping did).

Addresses #2032.
2022-04-14 11:11:03 +02:00
Robin Sommer
98b505e9dc
Merge remote-tracking branch 'origin/topic/robin/analyzer-violation-tag'
* origin/topic/robin/analyzer-violation-tag:
  Allow analyzer violations to explicitly set tag.
2022-04-14 11:09:21 +02:00
Robin Sommer
fccb9ccab0
Re-instantiate providing location information to LoadFile hooks.
#1835 subtly changed the semantics of the `LoadFile` plugin hook to no
longer have the current script location available for signature files
being loaded through `@load-sigs`. This was undocumented behavior, so
it's technically not a regression, but since at least one external
plugin is depending on it, this change restores the old behavior.
2022-04-14 10:43:21 +02:00
Tim Wojtulewicz
2c9296120e Merge remote-tracking branch 'ynadji/add-enum-to-int-ordering-test'
* ynadji/add-enum-to-int-ordering-test:
  Add test to ensure enum_to_int's return values are ordered
2022-04-13 10:53:07 -07:00
Tim Wojtulewicz
5159350c6f Merge remote-tracking branch 'origin/topic/timw/get-word-test'
* origin/topic/timw/get-word-test:
  Add unit test for other get_word() version
2022-04-13 10:51:30 -07:00
Tim Wojtulewicz
3f06986896 Add unit test for other get_word() version 2022-04-12 15:30:13 -07:00
Robin Sommer
d2e8c5e887
Allow analyzer violations to explicitly set tag.
We could already pass an overriding tag to
`Analyzer::AnalyzerConfirmation()`, but we didn't have that ability
for `AnalyzerViolation`, leading to the two potentially mismatching in
the analyzer they report.
2022-04-12 09:36:14 +02:00
Christian Kreibich
d29160e9de Merge branch 'topic/christian/fix-tsan-supervisor'
* topic/christian/fix-tsan-supervisor:
  Mask our signal handlers' triggering signals around thread creation
2022-04-11 12:47:06 -07:00
Tim Wojtulewicz
8a99e343a5 Merge remote-tracking branch 'origin/topic/timw/2026-protocol-confirmation'
* origin/topic/timw/2026-protocol-confirmation:
  GH-2026: Ensure both protocol and analyzer confirmation and violation events can be called
2022-04-11 12:40:23 -07:00
Tim Wojtulewicz
007bc0c083 GH-2026: Ensure both protocol and analyzer confirmation and violation events can be called 2022-04-11 12:39:27 -07:00
Christian Kreibich
1440080791 Update doc submodule [nomail] [skip ci] 2022-04-11 12:36:23 -07:00
Yacin Nadji
8e225efd57 Add test to ensure enum_to_int's return values are ordered 2022-04-11 13:10:36 -04:00
Anthony Coddington
2aec7640dd GH-2038: Don't sleep when non-selectable PktSrc has data available
PktSrc::GetNextTimeout always returned a fixed timeout of 20 microseconds for non-selectable packet sources regardless of whether they have packets available. This adds unnecessary delay every FindReadySources poll_interval when packets are available to be read.

Instead, for non-selectable packet sources, check whether packets are available and return a timeout of 0 to indicate data is available. This is closer to the behaviour of the old capture loop.

This was mitigated somewhat by the fact FindReadySources poll interval defaults to 100 packets, and live sources are added to the ready list regardless of whether they have packets available (unless it is time to force a poll).
2022-04-11 23:21:31 +12:00
Christian Kreibich
9a11df808b Mask our signal handlers' triggering signals around thread creation
This avoids tsan complaints around race conditions in signal handlers running
from threads other than the main one.
2022-04-08 18:05:49 -07:00
Tim Wojtulewicz
de2d3435ce Merge remote-tracking branch 'origin/topic/timw/bump-libkqueue'
* origin/topic/timw/bump-libkqueue:
  Update libkqueue to 2.6.0 release [skip ci] [nomail]
2022-04-09 00:09:19 +00:00
Tim Wojtulewicz
3b50d810de Update libkqueue to 2.6.0 release [skip ci] [nomail] 2022-04-08 21:43:38 +00:00
Christian Kreibich
b17c992b47 Merge branch 'topic/christian/fix-install-symlink'
* topic/christian/fix-install-symlink:
  Bump submodules to pull in InstallSymlink fix [nomail]
2022-04-08 11:31:57 -07:00
Christian Kreibich
21b3bcea2b Bump submodules to pull in InstallSymlink fix [nomail] 2022-04-07 13:39:02 -07:00
Tim Wojtulewicz
d0e13a1e79 Merge remote-tracking branch 'origin/topic/vern/table-attr-fixes'
* origin/topic/vern/table-attr-fixes:
  updates for btests - new cases to check, new baselines
  updates for btests - new cases to check, new baselines
  fix for ill-formed (complex) &default function
  type-checking for use of empty table constructors in expressions
  catch empty constructors used for type inference suppress repeated error messages
  factoring to make checking of &default attributes externally accessible
  bug fix for empty table constructors with &default attributes (plus a typo)
2022-04-05 18:05:15 -07:00
Tim Wojtulewicz
e0ad92c9f4 Merge remote-tracking branch 'origin/topic/vern/ZAM-frame-opt'
* origin/topic/vern/ZAM-frame-opt:
  reduce interpreter frames for compiled function bodies
2022-04-05 18:04:28 -07:00
zeek-bot
cc50129dc3 Update doc submodule [nomail] [skip ci] 2022-04-06 00:34:19 +00:00
Christian Kreibich
5e937e4038 Merge branch 'topic/christian/gh-1994'
* topic/christian/gh-1994:
  Correct origin documentation of the version field in the HTTP log.
2022-04-05 16:08:02 -07:00
Christian Kreibich
669cfbe109 Correct origin documentation of the version field in the HTTP log. 2022-04-04 14:22:58 -07:00
Christian Kreibich
5ccc3ea156 Merge branch 'topic/christian/news-additions'
* topic/christian/news-additions:
  Move new TLS decryption capabilities up to Zeek 5 in NEWS file
  Update NEWS to reflect recent updates
2022-04-04 13:27:49 -07:00
Tim Wojtulewicz
03109733e7 Merge remote-tracking branch 'origin/topic/vern/ZAM-loops-fix'
* origin/topic/vern/ZAM-loops-fix:
  fix & btest for ZAM bug with inlined nested loop
2022-04-04 10:52:51 -07:00
Tim Wojtulewicz
1b67464d25 Merge remote-tracking branch 'origin/topic/timw/const-cast-zip'
* origin/topic/timw/const-cast-zip:
  GH-2009: Use auto to fix ZIP analyzer failure on some platforms
2022-04-04 10:51:31 -07:00
Tim Wojtulewicz
ffb9ba1f26 GH-2009: Use auto to fix ZIP analyzer failure on some platforms 2022-04-03 16:48:51 -07:00
Vern Paxson
03194949c9 reduce interpreter frames for compiled function bodies 2022-04-01 18:00:11 -07:00
Vern Paxson
84dc430e00 fix & btest for ZAM bug with inlined nested loop 2022-04-01 14:04:50 -07:00
Vern Paxson
33d804db16 Merge branch 'topic/vern/table-attr-fixes' of github.com:zeek/zeek into topic/vern/table-attr-fixes 2022-03-31 20:44:11 -07:00
Vern Paxson
77007eccf8 updates for btests - new cases to check, new baselines 2022-03-31 20:42:54 -07:00
Vern Paxson
215e6ea098 updates for btests - new cases to check, new baselines 2022-03-31 19:31:58 -07:00
Vern Paxson
24be03f7c5 fix for ill-formed (complex) &default function 2022-03-31 19:31:21 -07:00
Vern Paxson
e786ba2fa9 type-checking for use of empty table constructors in expressions 2022-03-31 19:30:58 -07:00
Vern Paxson
4d2115ffd3 catch empty constructors used for type inference
suppress repeated error messages
2022-03-31 19:30:00 -07:00
Vern Paxson
ffdcc36bd5 factoring to make checking of &default attributes externally accessible 2022-03-31 19:29:17 -07:00
Vern Paxson
18fe9d84f6 bug fix for empty table constructors with &default attributes (plus a typo) 2022-03-31 19:28:23 -07:00
Christian Kreibich
b956539b46 Move new TLS decryption capabilities up to Zeek 5 in NEWS file 2022-03-31 15:55:25 -07:00
Christian Kreibich
67012b96ff Update NEWS to reflect recent updates 2022-03-29 10:59:24 -07:00
Christian Kreibich
aa8f11fa17 Merge branch 'topic/christian/gh-1963'
* topic/christian/gh-1963:
  Add cmake-time reporting of bifcl, binpac, and gen-zam used for build
  Build Gen-ZAM from a submodule and support use of pre-existing executable
2022-03-28 17:05:09 -07:00
Christian Kreibich
0d29346ca3 Update doc submodule [nomail] [skip ci] 2022-03-28 10:50:14 -07:00
Christian Kreibich
0a2cd1e99f Update doc submodule [nomail] [skip ci] 2022-03-28 09:57:33 -07:00
zeek-bot
8929bcb48e Update doc submodule [nomail] [skip ci] 2022-03-26 00:34:23 +00:00
Tim Wojtulewicz
fe935a572f Merge remote-tracking branch 'origin/topic/vern/event-trace'
* origin/topic/vern/event-trace:
  low-level style tweaks
  --event-trace / -E option to generate event trace
  hooks to support event tracing
  classes providing event-tracing/dumping functionality
  provide access to Val internals for event tracing purposes
  set_network_time() BiF in support of event replaying
  low-level naming tweaks / comments / const-ified accessor
2022-03-25 15:31:42 -07:00
zeek-bot
e2b2220201 Update doc submodule [nomail] [skip ci] 2022-03-25 00:36:00 +00:00
Tim Wojtulewicz
3c66fb11cb Merge remote-tracking branch 'origin/topic/vern/init-integration'
* origin/topic/vern/init-integration:
  updates for compile-to-C++
  updates for ZAM optimization
  btest tweaks I overlooked
  updates for script optimization
  new btests to cover extended functionality & associatd errors
  updates to btests to support switch to expression-based initialization
  tweaks to base scripts revealed by switch to expression-based initialization
  switch variable initialization over to being expression-based
  simplification of Val classes now that they don't have to support initialization
  factoring and re-working of type merging
  use new interface for associating attributes with constructors
  rework type inference due to switch from separate initializers to expressions
  avoid evaluating calls to determine whether an expression value is ignored
  reworking of expressions to unify =/+=/-= with initialization
  allow {} expression lists for =/+=/-= RHS
  tweak for comparing redundant-but-complex attributes
2022-03-24 11:02:11 -07:00