]> git.ipfire.org Git - thirdparty/bind9.git/commitdiff
Add PoC for assertion failure on large TCP DNS messages
authorOndřej Surý <ondrej@isc.org>
Fri, 31 Jul 2020 08:08:41 +0000 (10:08 +0200)
committerOndřej Surý <ondrej@isc.org>
Mon, 31 Aug 2020 11:38:17 +0000 (13:38 +0200)
(cherry picked from commit 2c796bb9c8c00a74ce3cf811717cb33c98a726fc)

bin/tests/system/tcp/1996-alloc_dnsbuf-crash-test.pkt [new file with mode: 0644]
bin/tests/system/tcp/tests.sh
util/copyrights

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 (file)
index 0000000..b723cef
Binary files /dev/null and b/bin/tests/system/tcp/1996-alloc_dnsbuf-crash-test.pkt differ
index 7e78d634affe8a1c7d597b1249f3746c513ad5e4..618d435c8269b30972d5916f90357db5e776926a 100644 (file)
@@ -184,5 +184,13 @@ grep "status: NXDOMAIN" dig.out.test$n > /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
index 503dc9d04befc6310558744cac55c7e05bcf1bc9..0e88c2ef09dade5f927e2417180930d6f637f277 100644 (file)
 ./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/system-test-driver.sh       X       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/prereq.sh               SH      2019,2020