From 2c796bb9c8c00a74ce3cf811717cb33c98a726fc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ond=C5=99ej=20Sur=C3=BD?= Date: Fri, 31 Jul 2020 10:08:41 +0200 Subject: [PATCH] Add PoC for assertion failure on large TCP DNS messages --- .../system/tcp/1996-alloc_dnsbuf-crash-test.pkt | Bin 0 -> 31 bytes bin/tests/system/tcp/tests.sh | 8 ++++++++ util/copyrights | 1 + 3 files changed, 9 insertions(+) create mode 100644 bin/tests/system/tcp/1996-alloc_dnsbuf-crash-test.pkt diff --git a/bin/tests/system/tcp/1996-alloc_dnsbuf-crash-test.pkt b/bin/tests/system/tcp/1996-alloc_dnsbuf-crash-test.pkt new file mode 100644 index 0000000000000000000000000000000000000000..b723cef1d95d5cfc81119dd8202dc87868d83a80 GIT binary patch literal 31 gcmZROWdH$2Fv-ANUS7_eS)9zAUzE /dev/null || ret=1 if [ $ret != 0 ]; then echo_i "failed"; fi status=$((status + ret)) +n=$((n + 1)) +echo_i "checking that BIND 9 doesn't crash on long TCP messages ($n)" +ret=0 +$PERL ../packet.pl -a "10.53.0.1" -p "${PORT}" -t udp 1996-alloc_dnsbuf-crash-test.pkt || ret=1 +dig_with_opts +tcp @10.53.0.1 txt.example > dig.out.test$n || ret=1 +if [ $ret != 0 ]; then echo_i "failed"; fi +status=$((status + ret)) + echo_i "exit status: $status" [ $status -eq 0 ] || exit 1 diff --git a/util/copyrights b/util/copyrights index 663e53a7df..b27720e05a 100644 --- a/util/copyrights +++ b/util/copyrights @@ -846,6 +846,7 @@ ./bin/tests/system/synthfromdnssec/ns1/sign.sh SH 2017,2018,2019,2020 ./bin/tests/system/synthfromdnssec/setup.sh SH 2017,2018,2019,2020 ./bin/tests/system/synthfromdnssec/tests.sh SH 2017,2018,2019,2020 +./bin/tests/system/tcp/1996-alloc_dnsbuf-crash-test.pkt X 2020 ./bin/tests/system/tcp/ans6/ans.py PYTHON 2019,2020 ./bin/tests/system/tcp/clean.sh SH 2014,2016,2018,2019,2020 ./bin/tests/system/tcp/setup.sh SH 2018,2019,2020