Commit graph

12419 commits

Author SHA1 Message Date
Johanna Amann
14f919895d Add documentation for GH-1829
This adds documentation that clarifies that the `ignore_checksums`
option now also allows IPv4 packets with a length of 0.
2021-11-16 13:51:29 +00:00
Johanna Amann
a011b4cb70 Packets with TSO: address review feedback.
This addresses review feedback of GH-1831 and additionally fixes one
case in which PayloadLen was used in a way that would have given
problematic results when TSO is enabled.
2021-11-09 15:11:27 +00:00
Johanna Amann
e14b695497 Accept packets that use tcp segment offloading.
When checksum offloading is enabled, we now forward packets that
have 0 header lengths set - and assume that they have TSO enabled.

If checksum offloading is not enabled, we drop the packets.

Addresses GH-1829
2021-10-28 17:12:54 +02:00
Tim Wojtulewicz
20d1b89caa Merge remote-tracking branch 'origin/topic/timw/clang-format-update'
* origin/topic/timw/clang-format-update:
  Apply some missing clang-format changes
2021-10-21 17:24:02 -07:00
Tim Wojtulewicz
e63ea95664 Apply some missing clang-format changes 2021-10-21 16:38:57 -07:00
zeek-bot
34694e67ea Update doc submodule [nomail] [skip ci] 2021-10-21 00:34:50 +00:00
Tim Wojtulewicz
3621fa943b Merge branch 'topic/timw/trailing-whitespace'
* topic/timw/trailing-whitespace:
  Remove trailing whitespace from script files
2021-10-20 11:13:36 -07:00
Tim Wojtulewicz
a6378531db Remove trailing whitespace from script files 2021-10-20 09:57:09 -07:00
zeek-bot
237a21c3bf Update doc submodule [nomail] [skip ci] 2021-10-20 00:44:09 +00:00
Johanna Amann
303e84ad86 Merge branch 'master' of https://github.com/FlyingWithJerome/zeek
Merge includes small changes, e.g. fixing the comsumption of remaining
raw data.

* 'master' of https://github.com/FlyingWithJerome/zeek:
  remove excussive fields in dns_svcb_rr
  address code reviews (formatting and type and intrusiveptr)
  newlines at the end of test outputs
  lazy commit
  use tabs in init-bare.zeek
  add svcb test case
  add a dns https test case
  remove test logs
  fix a few syntax errors
  initial commit for SVCB/HTTPS records
2021-10-19 15:03:08 +02:00
Johanna Amann
1b3b9a3cfc Merge branch 'fsync-shadow-files-before-rename' of https://github.com/awelzel/zeek
* 'fsync-shadow-files-before-rename' of https://github.com/awelzel/zeek:
  logging/writers/ascii: shadow files: Add fsync() before rename()
2021-10-15 09:47:08 +01:00
Tim Wojtulewicz
59013dedcf Fix typo in typedef changes that broke tests on 32-bit Debian 9 2021-10-14 13:09:54 -07:00
Christian Kreibich
5d3568d08d Bump zeek-aux submodule to pull in update-changes tweak [nomail] [skip ci] 2021-10-14 11:57:48 -07:00
Arne Welzel
dc6e21d6ae logging/writers/ascii: shadow files: Add fsync() before rename()
We're using shadow files for log rotation on systems with ext4 running
Linux 4.19. We've observed zero-length shadow files in the logger's working
directory after a power-outage. This leads to a broken/stuck logger
process due to empty shadow files being considered invalid and the
process exiting:

    error: failed to process leftover log 'conn.log.gz': Found leftover log, 'conn.log.gz', but the associated shadow  file, '.shadow.conn.log.gz', required to process it is invalid

PR #1137 introduced atomic renaming of shadow files and was supposed to
handle this. However, after more investigation, the rename() has to be
preceded by an fsync() in order to avoid zero-length files in the presence
of hard-crashes or power-failures. This is generally operating system
and filesystem dependent, but should not hurt to add. The performance impact
can likely be neglected due to the low frequency and limited number of
log streams.

This has happened to others, too. Some references around this issue:

* https://stackoverflow.com/questions/7433057/is-rename-without-fsync-safe
* https://unix.stackexchange.com/questions/464382/which-filesystems-require-fsync-for-crash-safety-when-replacing-an-existing-fi
* https://bugzilla.kernel.org/show_bug.cgi?id=15910

Reproducer

This issue was reproduced artificially on Linux using the sysrq-trigger
functionality to hard-reset the system shortly after a .shadow file was
renamed to it's final destination with the following script watching for
.shadow.conn.log.gz:

    #!/bin/bash
    set -eu
    dir=/data/logger-01/

    # Allow everything via /proc/sysrq-trigger
    echo "1" > /proc/sys/kernel/sysrq

    inotifywait -m -e MOVED_TO --format '%e %w%f' "${dir}" | while read -r line; do
        if echo "${line}" | grep -q '^MOVED_TO .*/.shadow.conn.log.gz$'; then
            echo "RESET: $line"
            sleep 4
            # Trigger a hard-reset without sync/unmount
            echo "b" > /proc/sysrq-trigger
        fi
    done

This quite reliably (4 out of 4 times) yielded a system with zero-length
shadow files and a broken logger after it came back online:

    $ ls -lha /data/logger-01/.shadow.*
    -rw-r--r-- 1 bro bro 0 Oct 14 02:26 .shadow.conn.log.gz
    -rw-r--r-- 1 bro bro 0 Oct 14 02:26 .shadow.dns.log.gz
    -rw-r--r-- 1 bro bro 0 Oct 14 02:26 .shadow.files.log.gz

After this change while running the reproducer, the shadow files always
contained content after a hard-reset.

Rework with util::safe_fsync helper
2021-10-14 15:54:45 +02:00
FlyingWithJerome
605d4024e4 remove excussive fields in dns_svcb_rr 2021-10-12 21:40:56 -04:00
FlyingWithJerome
c957e3e91e address code reviews (formatting and type and intrusiveptr) 2021-10-12 20:36:35 -04:00
FlyingWithJerome
ac1ea204fe newlines at the end of test outputs 2021-10-12 17:43:32 -04:00
FlyingWithJerome
b238cf3dca lazy commit 2021-10-12 17:43:32 -04:00
FlyingWithJerome
33c7fd5fba use tabs in init-bare.zeek 2021-10-12 17:43:32 -04:00
FlyingWithJerome
d5a6896171 add svcb test case 2021-10-12 17:43:32 -04:00
FlyingWithJerome
ca4b181d35 add a dns https test case 2021-10-12 17:43:32 -04:00
FlyingWithJerome
8f7f75fcb4 remove test logs 2021-10-12 17:43:32 -04:00
FlyingWithJerome
0849332eb9 fix a few syntax errors 2021-10-12 17:43:32 -04:00
FlyingWithJerome
8fce51bf83 initial commit for SVCB/HTTPS records 2021-10-12 17:43:32 -04:00
Christian Kreibich
4d48272adb Bump zkg to 2.12.0 [nomail] [skip ci] 2021-10-12 14:05:47 -07:00
Tim Wojtulewicz
aedacf2a6c Merge remote-tracking branch 'origin/topic/timw/modernize-typedef'
* origin/topic/timw/modernize-typedef:
  Replace most uses of typedef with using for type aliasing
2021-10-12 09:23:00 -07:00
Tim Wojtulewicz
64748edab1 Replace most uses of typedef with using for type aliasing 2021-10-11 14:51:10 -07:00
Christian Kreibich
7101f30646 Merge branch 'topic/christian/ci-tweaks-freebsd-testsuite'
* topic/christian/ci-tweaks-freebsd-testsuite:
  Don't initialize private testsuite in CI when not running out of Zeek project
  Drop FreeBSD 11.4 (now EOL), add FreeBSD 14 as informational build
2021-10-11 11:39:24 -07:00
Christian Kreibich
e95494953f Update doc submodule [nomail] [skip ci] 2021-10-11 11:13:47 -07:00
Christian Kreibich
b66e607e5f Don't initialize private testsuite in CI when not running out of Zeek project
The initialization of the private testsuite currently fails builds run in
forks. Cirrus's encrypted variables won't work outsize of the Zeek project, so
skip that setting altogether.
2021-10-05 12:37:02 -07:00
Christian Kreibich
f269b2ef91 Drop FreeBSD 11.4 (now EOL), add FreeBSD 14 as informational build 2021-10-05 10:47:03 -07:00
Christian Kreibich
d1c6e9e226 Merge branch 'topic/christian/complex-indices'
* topic/christian/complex-indices:
  Expand table/set tests to cover new index types
  Expression tweaks to get complex types to work as container indices
  Whitespace tweak in a btest, no other change
2021-10-04 12:48:51 -07:00
Christian Kreibich
dbdd07b93f Merge branch 'topic/christian/docker-tweaks'
* topic/christian/docker-tweaks:
  Enable customization of the Docker image's configure invocation
  Add Python Broker module load test to Docker image btests
  Set PYTHONPATH in Docker to automatically find Zeek's modules
  Docker image fix: libpython needs to be 3.9 on Debian Bullseye
2021-10-01 14:20:09 -07:00
Christian Kreibich
a8ab977b0e Expand table/set tests to cover new index types 2021-10-01 14:03:08 -07:00
Christian Kreibich
175d9297e3 Expression tweaks to get complex types to work as container indices 2021-10-01 14:03:08 -07:00
Christian Kreibich
b7603faf3d Whitespace tweak in a btest, no other change 2021-10-01 14:03:08 -07:00
Christian Kreibich
0e5e01f65f Merge branch 'topic/christian/bump-highwayhash'
* topic/christian/bump-highwayhash:
  CI tweak: upgrade curl on FreeBSD to avoid cert expiration
  CI tweak: add a datestamp to Debian 9 Dockerfiles to invalidate Cirrus build cache
  Bump highwayhash submodule to pull in another FreeBSD header fix
2021-10-01 13:29:28 -07:00
Christian Kreibich
eadb8648e6 CI tweak: upgrade curl on FreeBSD to avoid cert expiration 2021-10-01 11:56:27 -07:00
Christian Kreibich
9eb2696895 CI tweak: add a datestamp to Debian 9 Dockerfiles to invalidate Cirrus build cache 2021-10-01 11:56:24 -07:00
Christian Kreibich
acde4d1765 Bump highwayhash submodule to pull in another FreeBSD header fix 2021-09-30 10:39:43 -07:00
Christian Kreibich
946e4f8a42 Enable customization of the Docker image's configure invocation 2021-09-30 08:41:21 -07:00
Christian Kreibich
ee58cb5785 Add Python Broker module load test to Docker image btests
We missed the fact that the broker module didn't load due to a wrong libpython
version because we didn't test that load.

Also remove an unused environment variable from btest.cfg.
2021-09-30 08:41:21 -07:00
Christian Kreibich
25f86d1d7f Set PYTHONPATH in Docker to automatically find Zeek's modules 2021-09-30 08:41:21 -07:00
Christian Kreibich
eaa39a489f Docker image fix: libpython needs to be 3.9 on Debian Bullseye 2021-09-30 08:41:20 -07:00
zeek-bot
9aadc7e42a Update doc submodule [nomail] [skip ci] 2021-09-29 00:36:58 +00:00
Tim Wojtulewicz
d85d20b7f6 Merge remote-tracking branch 'origin/topic/timw/1766-remove-zero-address'
* origin/topic/timw/1766-remove-zero-address:
  GHI-1766: Remove address from Site::private_address_space that converts into 0.0.0.0/0
2021-09-28 10:05:01 -07:00
Tim Wojtulewicz
0f348ea042 GHI-1766: Remove address from Site::private_address_space that converts into 0.0.0.0/0 2021-09-27 14:24:14 -07:00
Tim Wojtulewicz
ff98515f2a Merge remote-tracking branch 'origin/topic/timw/clang-format-fixes'
* origin/topic/timw/clang-format-fixes:
  clang-format: Set penalty for breaking after assignment operator
  clang-format: Set IndentCaseBlocks to false
  clang-format: Other minor formatting changes
  clang-format: Other include ordering changes
  clang-format: Enforce ordering of includes in ZBody
  clang-format: A few minor comment-spacing fixes
  clang-format: Force zeek-config.h to be earlier in the config ordering
2021-09-27 12:07:21 -07:00
Tim Wojtulewicz
9af6b2f48d clang-format: Set penalty for breaking after assignment operator 2021-09-27 10:49:48 -07:00
Tim Wojtulewicz
4423574d26 clang-format: Set IndentCaseBlocks to false 2021-09-27 10:49:48 -07:00