]> 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 10:04:01 +0000 (12:04 +0200)
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 0f4deb8e37b0ebda93d97cfeebd91ef2f8b4927d..af92b95d744f646750090f20609d359da53421fb 100644 (file)
@@ -183,5 +183,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 663e53a7df79ed09478696d09ff4f19a39ee07e4..b27720e05ac13ccb748995e9f6a55396a7d56837 100644 (file)
 ./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