forked from zeek/zeek
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCHANGES
21693 lines (13834 loc) · 747 KB
/
CHANGES
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
3.2.0-dev.192 | 2020-02-28 11:36:12 -0800
* threading::Queue::WakeUp(): lock mutex before notifying condition_variable (Max Kellermann)
Not locking the associated mutex can create race conditions and lockups.
3.2.0-dev.190 | 2020-02-28 00:42:17 -0800
* Stmt: use class IntrusivePtr (Max Kellermann)
* Stmt: remove unused default constructors and `friend` declarations (Max Kellermann)
* Val: remove unimplemented prototype recover_val() (Max Kellermann)
* Val: cast_value_to_type() returns IntrusivePtr (Max Kellermann)
* Val: use IntrusivePtr in check_and_promote() (Max Kellermann)
* Val: use nullptr instead of 0 (Max Kellermann)
* zeekygen: use class IntrusivePtr (Max Kellermann)
* ID: use class IntrusivePtr (Max Kellermann)
* Expr: use class IntrusivePtr (Max Kellermann)
* Var: copy Location to stack, to fix use-after-free crash bug (Max Kellermann)
* Scope: lookup_ID() and install_ID() return IntrusivePtr<ID> (Max Kellermann)
* Scope: delete duplicate locals (Max Kellermann)
* EventRegistry: automatically delete EventHandlers (Max Kellermann)
* main: destroy event_registry after iosource_mgr (Max Kellermann)
Fixes use-after-free bugs because PcapSource::Close() queues an event.
* zeekygen/IdentifierInfo: delete duplicate fields (Max Kellermann)
* main: free the global scope in terminate_bro() (Max Kellermann)
Make valgrind a bit happier.
* Scope: pop_scope() returns IntrusivePtr<> (Max Kellermann)
* Scope: unref all inits in destructor (Max Kellermann)
* Var: pass IntrusivePtr to add_global(), add_local() etc. (Max Kellermann)
* plugin/ComponentManager: hold a reference to the EnumType (Max Kellermann)
Use class IntrusivePtr<>.
* Type: fix use-after-free bug in VectorType::ShallowClone() (Max Kellermann)
The new VectorType instance needs a new reference to the `yield_type`.
* Var: fix crash when redeclaring a function with different args (Max Kellermann)
3.2.0-dev.167 | 2020-02-27 14:24:55 -0800
* Expr: use fmt instead of sprintf (Tim Wojtulewicz, Corelight)
* Expr: other minor initialization cleanup (Tim Wojtulewicz, Corelight)
* Expr: use List::empty() (Tim Wojtulewicz, Corelight)
* Expr: Convert a bunch of methods returning ints to return bools (Tim Wojtulewicz, Corelight)
* IPAddr: minor cleanup (Tim Wojtulewicz, Corelight)
- Mark empty constructors/destructors as default
- Initialization cleanup
- Remove unnecessary elses from before returns
* PriorityQueue: initialization cleanup (Tim Wojtulewicz, Corelight)
* IP: Cleanup initialization, make a few functions consistent (Tim Wojtulewicz, Corelight)
3.2.0-dev.159 | 2020-02-26 19:51:24 -0800
* Pop global frame stack on exception. (Johanna Amann, Corelight)
When changing this code for 3.0.0, the code-flow changed significantly.
One of the changes lead to exception being re-thrown from Call - which
leads to the function cleanup not always being run. While the Unref of
the framepointer was (correctly) moved into the catch block, the global
frame stack was not cleaned up - and contains an invalid pointer after
encountering an interpreter exception.
This small commit pops the stack and removes the framepointer that was
pushed onto it before re-throwing the exception.
I also think that this change (re-throwing the exception) breaks the
Zeek debugger in significant ways (you cannot debug a script that causes
a Runtime error anymore).
3.2.0-dev.157 | 2020-02-26 10:04:32 -0800
* IntrusivePtr: overload std::swap() (Max Kellermann)
* IntrusivePtr: eliminate setPtr() (Max Kellermann)
There are only two call sites, and those hard-code the `add_ref`
parameter.
* IntrusivePtr: optimize release() using std::exchange() (Max Kellermann)
* Expr: remove unused default constructors and `friend` declarations (Max Kellermann)
* Remove useless override: RecordAssignExpr::Eval() (Max Kellermann)
* Type: don't pass reference to pointer to MatchesIndex() (Max Kellermann)
No implementation modifies the pointer value. To guard against this,
this commit changes `&` to `const`.
* Expr: don't pass reference to pointer to check_and_promote*() (Max Kellermann)
The function never modifies the pointer value.
check_and_promote_expr() is left untouched because it really does
modify the pointer.
* ID: remove unused default constructor (Max Kellermann)
* Scope: simplify PList access, use pop_back() and back() (Max Kellermann)
* List: add method empty() (Max Kellermann)
3.2.0-dev.146 | 2020-02-26 09:40:18 -0800
* Type: fix double free bug in SetType::ShallowClone() (Max Kellermann)
3.2.0-dev.144 | 2020-02-25 19:52:57 -0800
* Add a faster siphash24 implementation than the reference one (Tim Wojtulewicz, Corelight)
- Average of 10 runs of 2009-M57-day11-18.trace (release build at -O3):
- Master: 6.027s 93650 bytes max RSS
- Commit: 5.950s 93271 bytes max RSS
- Hashing a fixed 32-byte payload 10 million times with a fixed key:
- Master: 1.397411s
- Commit: 0.998211s
3.2.0-dev.142 | 2020-02-25 19:27:28 -0800
* Updates to Broker to build CAF as sub-project (Dominik Charousset, Corelight)
The embedded CAF now builds directly as a CMake subdirectory rather
than an external project.
3.2.0-dev.137 | 2020-02-24 20:41:43 -0800
* parse.y: fix memory leak in FieldAssignExpr call (Max Kellermann)
* parse.y: fix use-after-free bug in open-ended index_slice (Max Kellermann)
* Type: fix use-after-free bug in init_type() (Max Kellermann)
* Expr: fix potential memory leak in RecordCoerceExpr::Fold() (Max Kellermann)
* Expr: fix memory leak in RecordCoerceExpr::InitVal() (Max Kellermann)
* zeekygen/IdentifierInfo: fix memory leak in operator=() (Max Kellermann)
* Func: fix memory leaks in get_func_priority() (Max Kellermann)
* parse.y: fix several memory leaks after lookup_ID() (Max Kellermann)
* Func: fix memory leaks in check_built_in_call() (Max Kellermann)
* Var: fix memory leaks in add_global() and add_local() (Max Kellermann)
* Var: add missing references to `init` in add{,_and_assign}_local() (Max Kellermann)
* parse.y: hold reference on init_expr for zeekygen::Manager::Redef() (Max Kellermann)
* Expr: fix two memory leaks in AssignExpr::InitVal() (Max Kellermann)
* parse.y: fix memory leak after "&deprecated" without string (Max Kellermann)
* RuleMatcher: delete PatternSet instances in destructor (Max Kellermann)
* Fix reference counting in Option::set_change_handler() (Max Kellermann)
3.2.0-dev.120 | 2020-02-24 18:13:04 -0800
* Update zeek-testing commit (Jon Siwek, Corelight)
3.2.0-dev.119 | 2020-02-24 18:02:10 -0800
* Use IntrusivePtr in TableVal::ExpandAndInit() to clarify ownership (Max Kellermann)
3.2.0-dev.117 | 2020-02-24 18:53:03 -0700
* Switch to using [[deprecated]] attribute (Jon Siwek, Corelight)
3.2.0-dev.115 | 2020-02-24 18:48:50 -0700
* Improve formatting of doubles that are close to integers
Now checks for approximate floating point equality so that more doubles
get properly disambiguated from integers (Jon Siwek, Corelight)
* Improve HTTP version number comparisons
Previous use of floating point comparisons was not always stable. (Jon Siwek, Corelight)
* Add a 32-bit task to Cirrus CI config (Jon Siwek, Corelight)
* Replace va_list fmt() overload with vfmt()
Using an overload that takes a va_list argument potentially causes
accidental misuse on platforms (e.g. 32-bit) where va_list is
implemented as a type that may collide with commonly-used argument
types.
For example:
char* c = copy_string("hi");
fmt("%s", (const char*)c);
fmt("%s", c);
The first fmt() call correctly goes through fmt(const char*, ...) first,
but the second mistakenly goes through fmt(const char*, va_list) first
because variadic function overloads have lower priority during overload
resolution and va_list on a 32-bit system happens to be defined as a
pointer type that can match with "char*" but not "const char*". (Jon Siwek, Corelight)
* Format tables indexed by patterns consistently across 32-bit/64-bit
Uses a full 64 bit integer for length values regardless of actual size_t
to get consistent results between either 32-bit and 64-bit platforms. (Jon Siwek, Corelight)
* Format interval values consistently across 32-bit/64-bit platforms (Jon Siwek, Corelight)
3.2.0-dev.108 | 2020-02-24 17:24:07 -0800
* Change OpaqueVal/HashVal APIs to use IntrusivePtr (Max Kellermann)
3.2.0-dev.106 | 2020-02-24 17:07:10 -0800
* ScannedFile: Identify already scanned files by device and inode (Arne Welzel)
Zeek scripts located on separate filesystems, but sharing the same inode
number leads to scripts not being loaded. The reason is that a `ScannedFile`
is only identified by `st_ino` which is not enough to uniquely identify a
file in a system.
* GH-808: Add ZEEK_VERSION_NUMBER definition to zeek-config.h (Jon Siwek, Corelight)
This is the result of (major * 10000 + minor * 100 + patch), for example
3.1.2 becomes 30102. This definition may be helpful for external code
that requires conditional compilation to support multiple Zeek
versions with differing APIs.
* Fix CI to checkout right commit of zeek-testing-private (Jon Siwek, Corelight)
3.2.0-dev.99 | 2020-02-21 21:23:52 -0800
* Update a URL in CI README (Jon Siwek, Corelight)
3.2.0-dev.98 | 2020-02-21 20:04:30 -0800
* Val: use C++ initializers (Max Kellermann)
* Val: add BroValUnion constructors (Max Kellermann)
* Val: reduce duplicate code by using delegating constructors (Max Kellermann)
* Val: remove unused default constructors and `friend` declarations (Max Kellermann)
* Val: remove the unnecessary BroValUnion typedef (Max Kellermann)
* Type: remove unnecessary enum typedefs (Max Kellermann)
* Type: use C++ initializers (Max Kellermann)
* Type: move code from BroType::BroType() to constexpr functions (Max Kellermann)
Prepare to inline the constructor, which will one day be `constexpr`
(requires moving the `std::string name` field somewhere else).
* Type: remove useless BroType destructor (Max Kellermann)
* Obj: disallow copying BroObj (Max Kellermann)
Copying a BroObj is dangerous, and should only be done with dedicated
(virtual) methods which are implemented by all derived classes. This
commit avoids unintentional copies.
* Obj: use C++ initializers (Max Kellermann)
* Obj: make `no_location` constexpr (Max Kellermann)
This ensures that the variable is initialized at compile time and may
allow the compiler to apply more initializations.
3.2.0-dev.85 | 2020-02-21 15:29:45 -0800
* threading/MsgThread: add [[noreturn]] to InternalError() (Max Kellermann)
* Flare: add [[noreturn]] to bad_pipe_op() (Max Kellermann)
* Obj: add [[noreturn]] attributes to Internal(), bad_ref() (Max Kellermann)
* Reporter: add [[noreturn]] attribute to several methods (Max Kellermann)
3.2.0-dev.80 | 2020-02-21 10:14:05 -0800
* OpaqueVal: remove misplaced `virtual` keywords (Max Kellermann)
These methods are not meant to be overridden.
* CompHash: use class IntrusivePtr for the `type` field (Max Kellermann)
* IntrusivePtr: replace the "add_ref" parameter with tag structs (Max Kellermann)
Using a runtime parameter is obscure and error-prone. Avoiding
error-prone code and getting reference counting right is the whole
point of this class.
* IntrusivePtr: remove reset(), nobody uses it (Max Kellermann)
This method mimicks std::unique_ptr::reset(), but adds an obscure
"add_ref" parameter which is error prone. Since nobody uses this
method, and this method is all about dealing with raw pointers which
we shouldn't be doing, let's remove it.
* IntrusivePtr: remove ordering operators (Max Kellermann)
These violate the C++ standard because comparing pointers to unrelated
objects is undefined behavior.
* IntrusivePtr: rename detach() to release() (Max Kellermann)
Follow the C++ standard library conventions (here: `std::unique_ptr`).
* IntrusivePtr: move nullptr initializer to field declaration (Max Kellermann)
This allows "defaulting" the default constructor, and guarantees that
all constructors really initialize the field to a legal value.
3.2.0-dev.71 | 2020-02-20 14:57:58 -0800
* Fix missing reference count incrment in AssignExpr::InitVal() (Max Kellermann)
3.2.0-dev.69 | 2020-02-19 18:40:58 -0800
* Fix various reference counting issues in Assign() implementations/callers (Jon Siwek, Corelight)
* Fix memory leak in Input stream creation when using &type_column (Max Kellermann)
* Fix two memory leaks in BloomFilterVal::Merge() (Max Kellermann)
* Fix memory leaks in script debugger (Max Kellermann)
* scan.l: fix missing Unref() in do_atif() (Max Kellermann)
* Fix parse-time memory leak in RecordConstructorExpr::InitVal() (Max Kellermann)
* Fix memory leaks in AssignExpr::EvalIntoAggregate() error conditions (Max Kellermann)
* Fix memory leaks in CondExpr::Eval() error conditions (Max Kellermann)
Also fixes reference counting issue for vector-based conditionals.
* Fix memory leaks in BoolExpr::Eval() error conditions (Max Kellermann)
* Fix various memory leaks in Assign() error conditions (Max Kellermann)
* Fix memory leaks in BinaryExpr::Eval() error conditions (Max Kellermann)
* Fix potential future memory leak in HTTP analyzer (Max Kellermann)
This isn't really a memory leak because ParseRequest() never fails,
but if it one day "learns" to fail, the `request_method` allocation
will leak.
3.2.0-dev.53 | 2020-02-18 12:12:28 -0800
* Make DNS NSEC3 parsing more resilient to introducing a memory leak
when no dns_NSEC3 handler exists (Max Kellermann)
* analyzer/protocol/dns: change runtime check to assert() (Max Kellermann)
If it were legal to call SendReplyOrRejectEvent() without an
EventHandlerPtr, then this would leak the `question_name` object. But
this method has just one caller, and it verifies the EventHandlerPtr.
* Fix memory leak when no dns_TSIG_addl event handler exists (Max Kellermann)
3.2.0-dev.46 | 2020-02-14 22:02:50 -0800
* Fix code format of various reporter btests (Jon Siwek, Corelight)
3.2.0-dev.45 | 2020-02-14 21:14:49 -0800
* Update libkqueue for a linux bugfix (Jon Siwek, Corelight)
3.2.0-dev.44 | 2020-02-14 16:16:54 -0700
* RE: make the RE_Matcher destructor non-virtual (Max Kellermann)
* analyzer/protocol/smtp: remove unnecessary nullptr check (Max Kellermann)
* analyzer/Manager: remove unnecessary clear() calls from destructor (Max Kellermann)
* analyzer/protocol/http: remove unnecessary empty destructor (Max Kellermann)
* iosource/pcap/Source: remove unused fields `last_hdr`, `last_data` (Max Kellermann)
* iosource/Manager: eliminate two std::string copies (Max Kellermann)
3.2.0-dev.37 | 2020-02-14 11:09:50 -0800
* Fix various format specifiers (Jon Siwek, Corelight)
3.2.0-dev.36 | 2020-02-14 10:29:36 -0700
* broker: include cleanup (Max Kellermann)
* file_analysis: include cleanup (Max Kellermann)
* file_analysis/Analyzer: eliminate duplicate constructor (Max Kellermann)
* probabilistic/Topk: include cleanup (Max Kellermann)
* digest: eliminate the "Reporter.h" include (Max Kellermann)
* Val: eliminate the "RE.h" include (Max Kellermann)
* Val: eliminate the "BroString.h" include (Max Kellermann)
* Val: eliminate the "CompHash.h" include (Max Kellermann)
* Val: forward-declare class PDict, reduce includes (Max Kellermann)
* Val: eliminate the "Scope.h" include (Max Kellermann)
3.2.0-dev.25 | 2020-02-13 19:05:56 -0800
* Reset the number of entries in a dict when calling Clear() (Tim Wojtulewicz, Corelight)
* Code cleanup in Dict.h (Tim Wojtulewicz, Corelight)
* Add unit testing for the public Dictionary API (Tim Wojtulewicz, Corelight)
3.2.0-dev.21 | 2020-02-13 17:14:26 -0800
* Check for failure when registering event manager with iosource manager
(Tim Wojtulewicz, Corelight)
3.2.0-dev.18 | 2020-02-12 00:04:40 -0800
* Fix SSH analyzer assertion/leak after duplicate KEX packet (Max Kellermann)
3.2.0-dev.16 | 2020-02-11 23:44:06 -0800
* Add missing #includes (clang-diagnostic-error) (Tim Wojtulewicz, Corelight)
* Remove unnecessary const from a return value
(readability-const-return-type) (Tim Wojtulewicz, Corelight)
* Create SegmentProfiler objects with names (bugprone-unused-raii)
(Tim Wojtulewicz, Corelight)
The reason behind this one is that without a real variable name, the
profile objects are immediately desctructed and the profiling only happens
for the small window when they were valid. If the intention is to profile
the method where they were defined, this doesn't actually happen.
* Mark a few clang-tidy findings as false-positive (Tim Wojtulewicz, Corelight)
* Use std::move in a few places instead of copying argument
(performance-unnecessary-value-param) (Tim Wojtulewicz, Corelight)
* Use const-references in lots of places (preformance-unnecessary-value-param)
(Tim Wojtulewicz, Corelight)
* Use string_view for a couple of Dbg methods (Tim Wojtulewicz, Corelight)
* Use const references over copying variables
(performance-unnecessary-copy-initialization, performance-for-range-copy)
(Tim Wojtulewicz, Corelight)
* Use single-character version of string find() (performance-faster-string-find)
(Tim Wojtulewicz, Corelight)
* Move constructors/operators should be marked noexcept to avoid the compiler
picking the copy constructor instead (performance-noexcept-move-constructor)
(Tim Wojtulewicz, Corelight)
3.2.0-dev.1 | 2020-02-08 16:20:20 -0800
* Update Broker submodule (Jon Siwek, Corelight)
3.2.0-dev | 2020-02-08 16:01:42 -0800
* Update to start of 3.2.0 development (Jon Siwek, Corelight)
3.1.0-dev.603 | 2020-02-08 15:47:48 -0800
* Fix broken links in documentation (Jon Siwek, Corelight)
3.1.0-dev.602 | 2020-02-08 12:44:40 -0800
* Update submodules to release versions (Jon Siwek, Corelight)
3.1.0-dev.601 | 2020-02-08 09:40:15 -0800
* Update embedded CAF to 0.17.4 (Jon Siwek, Corelight)
3.1.0-dev.600 | 2020-02-07 21:10:00 -0800
* Note new CMake 3.0+ and C++17 requirements in NEWS (Jon Siwek, Corelight)
3.1.0-dev.599 | 2020-02-07 19:58:35 -0800
* Improve an input framework test (Jon Siwek, Corelight)
3.1.0-dev.598 | 2020-02-07 15:06:56 -0800
* Improve stability of a &expire_func btest (Jon Siwek, Corelight)
3.1.0-dev.597 | 2020-02-07 15:25:56 -0700
* plugin/Manager: migrate to std::string_view (Max Kellermann)
* util: optimize the normal_path() common case
Speeds up Zeek startup by 2%. (Max Kellermann)
* util: pass string_view to without_bropath_component() (Max Kellermann)
* module_util: make GLOBAL_MODULE_NAME constexpr
This allows the compiler to hard-code pointers to the string without
looking up a global variable at runtime. (Max Kellermann)
* Scope: convert Scope::Lookup() and others to template
Allows passing rvalue references which eliminates unnecessary
std::string copies.
This speeds up Zeek startup by 1-2%. (Max Kellermann)
* Scope: Vars() returns const reference
No caller wants to modify the container. (Max Kellermann)
* Anon: remove unnecessary {map,vector}::clear() calls
The destructor will do this automatically. (Max Kellermann)
* Dict: make the destructor non-virtual (Max Kellermann)
* Obj: make the Location constructors `constexpr` (Max Kellermann)
* Obj: remove unused fields Location::{timestamp,text} (Max Kellermann)
* Obj: remove Location::delete_data, nobody ever sets it
This allows removing the destructor completely, making the class
trivially-destructible. (Max Kellermann)
* Obj: make the Location destructor non-virtual
Nobody ever derives from this class. This removes an indirect call
and allows inlining the destructor.
This speeds up Zeek startup by 1-2%. (Max Kellermann)
3.1.0-dev.584 | 2020-02-07 14:12:17 -0800
* Improve kerberos analyzer address and event handling
Adds a weird, "invalid_kerberos_addr_len", for invalid kerberos host
address lengths and also fixes a memory leak when processing KRB_KDC_REQ
and KRB_KDC_REP messages for message types that do not match a
known/expected type. (Jon Siwek, Corelight)
3.1.0-dev.582 | 2020-02-07 09:46:00 -0800
* Add environment variable to disable supervisor SIGKILL
For use in btests since SIGKILL can otherwise bypass the usual
btest-bg-wait timeout mechanism and make reason for test failures less
obvious. (Jon Siwek, Corelight)
* Fix a btest's race condition by handling Pcap::file_done (Jon Siwek, Corelight)
* Add Pcap::file_done event
It signals when a pcap file is done being processed. (Jon Siwek, Corelight)
* Improve btest timeouts
* Generally increase timeouts for tests that have recent transient
failures
* Change any test that relied on `btest-bg-wait -k` since that's never
going to play with with CI systems. Instead, we always need to have
a well-defined termination condition in the test itself (and most
already did, so didn't really need the `-k` flag anyway). (Jon Siwek, Corelight)
3.1.0-dev.577 | 2020-02-07 09:43:48 -0800
* Use 2 btest retries for CI (Jon Siwek, Corelight)
3.1.0-dev.575 | 2020-02-07 09:31:50 -0800
* GH-780: Prevent log batches from indefinite buffering
Logs that got sent sparsely or burstily would get buffered for long
periods of time since the logic to flush them only does so on the next
log write. In the worst case, a subsequent log write could never happen
and cause a log entry to be indefinitely buffered.
This fix introduces a recurring event/timer to simply flush all pending
logs at frequency of Broker::log_batch_interval. (Jon Siwek, Corelight)
3.1.0-dev.571 | 2020-02-07 10:33:16 +0000
* Update NEWS to point out Broker wireformat change. (Robin Sommer,
Corelight)
3.1.0-dev.570 | 2020-02-06 14:58:34 -0800
* add &on_change attribute for sets/tables
The &on_change attribute allows users to specify a function that is
called when a set or table is changed via a direct insertion/delete/change
or element expiry.
Example:
function set_change(t: set[string], tpe: TableChange, idx: string)
{
print "set_change", idx, tpe;
}
global s: set[string] &on_change=set_change;
(Johanna Amann, Corelight)
3.1.0-dev.554 | 2020-02-06 13:05:39 -0800
* Switch GitHub Action for CI emails to use zeek organization (Jon Siwek, Corelight)
* Restore accidentally reverted change to fix FreeBSD 11 build (Tim Wojtulewicz, Corelight)
3.1.0-dev.552 | 2020-02-05 21:47:08 -0800
* Update CAF to current 0.17.4 release branch (Jon Siwek, Corelight)
3.1.0-dev.551 | 2020-02-05 17:50:56 -0800
* Remove presumed ownership of HeartbeatTimer (Jon Siwek, Corelight)
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.
* Set threading::Manager terminating state (Jon Siwek, Corelight)
Coverity CID 1417429
* Remove unused HeartbeatTimer member: do_expire (Jon Siwek, Corelight)
Coverity CID 1417434
3.1.0-dev.548 | 2020-02-05 14:57:08 -0800
* GH-773: Make EventMgr an IOSource so that events interrupt kevent waits (Tim Wojtulewicz, Corelight)
3.1.0-dev.546 | 2020-02-05 10:51:35 -0800
* Change threading formatter errors to warnings. (Johanna Amann, Corelight)
This change standardizes threading formatter error handling and moves
the remaining error calls to be warnings instead.
This is in line with already existing code - in most cases warnings were
raised, only a few cases raised errors. These cases do not differ
significantly from other cases in which warnings are raised.
This also fixes GH-692, in which misformatted lines prevent future file
parsing.
This commit also moves the FailWarn method that is used by both the
config and the ascii reader up to the ReaderBackend. Furthermore it
makes the Warning method of ReaderBackend respect the warning
suppression that is introduced by the FailWarn method.
* Update NEWS about plugin breakage from the include-file changes (Tim Wojtulewicz, Corelight)
3.1.0-dev.542 | 2020-02-04 14:05:19 -0700
* UID, ..: un-inline methods to reduce header dependencies
Only 1% build time speedup, but still, it declutters the headers a bit.
Before this patch:
2565.17user 141.83system 2:25.46elapsed 1860%CPU (0avgtext+0avgdata 1489076maxresident)k
72576inputs+9130920outputs (1667major+49400430minor)pagefaults 0swaps
After this patch:
2537.19user 142.94system 2:26.90elapsed 1824%CPU (0avgtext+0avgdata 1434268maxresident)k
16240inputs+8887152outputs (1931major+48728888minor)pagefaults 0swaps (Max Kellermann)
* include cleanup
The Zeek code base has very inconsistent #includes. Many sources
included a few headers, and those headers included other headers, and
in the end, nearly everything is included everywhere, so missing
#includes were never noticed. Another side effect was a lot of header
bloat which slows down the build.
First step to fix it: in each source file, its own header should be
included first to verify that each header's includes are correct, and
none is missing.
After adding the missing #includes, I replaced lots of #includes
inside headers with class forward declarations. In most headers,
object pointers are never referenced, so declaring the function
prototypes with forward-declared classes is just fine.
This patch speeds up the build by 19%, because each compilation unit
gets smaller. Here are the "time" numbers for a fresh build (with a
warm page cache but without ccache):
Before this patch:
3144.94user 161.63system 3:02.87elapsed 1808%CPU (0avgtext+0avgdata 2168608maxresident)k
760inputs+12008400outputs (1511major+57747204minor)pagefaults 0swaps
After this patch:
2565.17user 141.83system 2:25.46elapsed 1860%CPU (0avgtext+0avgdata 1489076maxresident)k
72576inputs+9130920outputs (1667major+49400430minor)pagefaults 0swaps (Max Kellermann)
* Updating submodule(s).
[nomail] (Jon Siwek, Corelight)
3.1.0-dev.538 | 2020-02-04 11:57:35 +0000
* Updating submodules.
3.1.0-dev.536 | 2020-02-03 15:44:10 -0700
* Change various functions to by-value std::string_view args (Jon Siwek, Corelight)
3.1.0-dev.534 | 2020-02-03 15:42:24 -0700
* Change packet source fields of Options to std::optional (Jon Siwek, Corelight)
3.1.0-dev.531 | 2020-02-03 13:23:22 -0800
* Update sqlite to 3.31.1 (Johanna Amann, Corelight)
* Update certificate list to state of NSS 3.49.2. (Johanna Amann, Corelight)
3.1.0-dev.530 | 2020-02-03 13:21:16 -0800
* Disable Travis leak test (Jon Siwek, Corelight)
Travis environment doesn't offer enough memory for running ASan very
well, but Cirrus has it covered anyway.
3.1.0-dev.529 | 2020-02-03 13:04:30 -0800
* CMakeLists.txt: fix cross-compilation with binpac (Fabrice Fontaine)
3.1.0-dev.527 | 2020-02-03 10:11:00 -0800
* Change requested memory in Cirrus CI config (Jon Siwek, Corelight)
The ASan build does require quite a bit more, but also the default
release builds should do ok with slightly less.
3.1.0-dev.526 | 2020-02-03 10:04:00 -0800
* Increase timeout value for live interfaces without file descriptors (Tim Wojtulewicz, Corelight)
* Use ranged-for loops in a few places in iosource Manager (Tim Wojtulewicz, Corelight)
* Change order of includes in iosource Manager, fixes build on FreeBSD 11 (Tim Wojtulewicz, Corelight)
3.1.0-dev.521 | 2020-01-31 14:18:17 -0800
* util: optimize expand_escape() by avoiding sscanf() (Max Kellermann)
sscanf() is notoriously slow, and the default scripts have lots of hex
escapes. This patch can reduce Zeek's startup time by 3-9%.
3.1.0-dev.519 | 2020-01-31 13:19:09 -0800
* util: optimize tokenize_string() and normalize_path() (Max Kellermann)
This patch can speed up Zeek startup by 10-25%.
Adds a new tokenize_string() overload which returns string_views and
changes existing tokenize_string() and normalize_path() to use string_view
arguments.
3.1.0-dev.510 | 2020-01-31 11:20:28 -0800
* Remove extra fmt() in a reporter->Error() call (Jon Siwek, Corelight)
* parse.y: Properly set location info for functions (Arne Welzel)
When defining a function, remember the location where the function header
was and restore it before calling `end_func()`. Inside `end_func()`, a
`BroFunc` object is created using the current global location information.
This came up while experimenting with zeek script profiling and wondering
why the locations set for `BroFunc` were "somewhere" in the middle of
functions instead of spanning them.
* Desc: move realloc() call out of the loop (Max Kellermann)
* SerializationFormat: move realloc() call out of the loop (Max Kellermann)
* PacketDumper: remove unused types (Max Kellermann)
3.1.0-dev.503 | 2020-01-31 11:00:32 -0800
* Show percentage of packets dropped in the final process output (Tim Wojtulewicz, Corelight)
* Remove concept of multiple timer managers (Tim Wojtulewicz, Corelight)
- All timers are now handled by a single global timer manager, which
simplifies how they handled by the IOSource manager.
- This change flows down a number of changes to other parts of the code.
The timer manager tag field is removed, which means that matching
connections to a timer manager is also removed. This removes the ability to
tag a connection as internal or external, since that's how the connections
where differentiated. This in turn removes the `current_conns_extern` field
from the `ConnStats` record type in the script layer.
* Have terminate_processing() raise SIGTERM instead of calling the signal handler directly (Tim Wojtulewicz, Corelight)
* PktSrc iosource changes to match the new IOSource API (Tim Wojtulewicz, Corelight)
* Broker manager changes to match the new IOSource API and loop architecture (Tim Wojtulewicz, Corelight)
* DNS_Mgr changes to match the new IOSource API and loop architecture (Tim Wojtulewicz, Corelight)
* Threading changes for the new loop architecture (Tim Wojtulewicz, Corelight)
- threading::Manager is no longer an IOSource.
- threading::MsgThread is now an IOSource. This allows threads themselves
to signal when they have data to process instead of continually checking
each of the threads on every loop pass.
- Make the thread heartbeat timer an actual timer and let it fire as
necessary instead of checking to see if it should fire
* Add Trigger manager for managing triggers created by things like 'when' statements
- Adds new trigger namespace (Tim Wojtulewicz, Corelight)
- Adds trigger::Manager class as a new IOSource for keeping track of
triggers and integrating them into the loop. Previously the loop relied on
the event manager Drain() method to process all triggers on every loop, but
now that the loop actively waits for events to occur, triggers would not
fire when they needed to. Adding them as part of the loop ensures they're
checked.
* Make TimerMgr an IOSource (Tim Wojtulewicz, Corelight)
- This allows the loop to check what the next timeout is and use that as
the basis for the timeout of the poll
- This commit also removes the TimerMgr::Tag type, since it causes a name
clash with other code in IOSource
* Modify IOSource Manager to implement new loop architecture (Tim Wojtulewicz, Corelight)
- Removes entire FindSoonest method that includes all of the calls to select() for checking for ready sources
- Removes FD_Set checking against IOSources
- Adds system for registering and unregistering file descriptors from
IOSources. This allows individual sources to mark themselves as ready to be
checked by the loop as they become available.
- Adds entirely new loop architecture based on checking the IOSources for
when their next timeout is, and then waiting for either that timeout or
when the next source is ready. This also implements the polling based on
what the OS supports, instead of just calling select() on all platforms.
Currently it supports kqueue, epoll, and plain poll.
- Adds system for pinging the loop to force it to wake up
* Minor amount of code cleanup in Pcap IO source (Tim Wojtulewicz, Corelight)
* IOSource API changes for new loop architecture (Tim Wojtulewicz, Corelight)
- Removed GetFD and NextTimestamp methods
- Removed concept of idle sources
- Renamed Init to InitSource to avoid a name clash with the thread code
- Added GetNextTimeout method
This commit also removes the FD_Set file since it's no longer used
* Type and variable usage cleanup in Net.h (Tim Wojtulewicz, Corelight)
* Remove #include of some iosource files from Net.h (Tim Wojtulewicz, Corelight)
* Only allow a single trace file (-r) or interface (-i) option on the command-line (Tim Wojtulewicz, Corelight)
* Remove CQ_TimerMgr in favor of PQ_TimerMgr (Tim Wojtulewicz, Corelight)
3.1.0-dev.482 | 2020-01-30 19:16:03 -0800
* Update NEWS for naming changes. (Robin Sommer, Corelight)
* Remove test for legacy plugin. (Robin Sommer, Corelight)
We no longer support creating new plugins using the old naming
scheme.
* Remove legancy symlinks in aux/. (Robin Sommer, Corelight)
That's aux/bro-aux and aux/broctl.
* Add warnings when loading scripts ending in ".bro", or using legacy environment variables. (Robin Sommer, Corelight)
* Fix missing rename to .zeek-dns-cache. (Robin Sommer, Corelight)
* No longer symlink local.zeek to local.bro. (Robin Sommer, Corelight)
* Update notice user agent. (Robin Sommer, Corelight)
* Remove old_comm_usage_is_ok. (Robin Sommer, Corelight)
* Remove bro-config.h.in and bro-path-dev.in. (Robin Sommer, Corelight)
* Change Bro wrapper script to now abort when old executable names are still used. (Robin Sommer, Corelight)
* Remove APIs that were explicitly deprecated to be removed in 3.1. (Robin Sommer, Corelight)
Special handling for bro_{init,done,script_loaded} events: if still
used, they cause Zeek to abort at startup.
3.1.0-dev.469 | 2020-01-30 08:44:15 -0700
* Fix leaked FDs in redirecting supervised node stdout/stderr (Jon Siwek, Corelight)
* Add checks for failed fcntl calls (Jon Siwek, Corelight)
* Set Pipe file descriptor flags correctly (Jon Siwek, Corelight)
3.1.0-dev.465 | 2020-01-29 11:45:15 -0800
* Scope: fix memory leak by removing duplicate copy_string() call (Max Kellermann)
Note this is a parse-time memory leak, not a run-time leak.
* util, nb_dns: fix off-by-one bugs in strncpy() calls (Max Kellermann)
Fortunately, these bugs had no effect because the following lines
overwrote the last character with a null byte.
* Type, util: add `constexpr` to static variables (Max Kellermann)
* Net: remove unused variable (Max Kellermann)
3.1.0-dev.460 | 2020-01-29 11:16:15 -0800
* Skip file analysis for zero-length SSL/TLS data (Jon Siwek, Corelight)
3.1.0-dev.458 | 2020-01-29 12:53:32 +0000
* Add a new supervisor framework that enables Zeek to operate
clusters of processes itself without any external help. (Jon
Siwek, Corelight)
The Supervisor framework provides an entirely new deployment mode
for Zeek, one that supervises a set of Zeek processes that are
meant to be persistent. A Supervisor automatically revives any
process that dies or exits prematurely and also arranges for an