Named Crashed: named aborted while handling dns query with certain format.
Summary
named server crashes down due to an assertion failure
while handling dns query with certain format.
name.c:692: ENSURE(name->labels <= 127) failed
BIND version used
BIND 9.19.12-dev (Development Release) <id:91c4792>
Steps to reproduce
step1. launch a named server
Launch a named use a regular config file.
options {
directory "/path/to/directory";
allow-query { any; };
listen-on port specify-a-port { any; };
};
step2. build a dns query
The query should contain at least one question
. To the name field
of that question, it constains exactly 127 labels
and each label is consists of one ASCII control character
. Here is an eg.
$ hexdump dnsquery
0000000 76c7 0001 0100 0000 0000 0000 1f01 0401
0000010 1101 1201 0201 1901 1e01 1401 0101 0601
0000020 1b01 0601 0401 0f01 1401 7f01 0701 1b01
0000030 1901 0f01 0b01 1b01 0f01 0b01 0f01 1101
0000040 1f01 1401 0901 1401 0701 0e01 1601 0401
0000050 1501 0901 1901 0601 1101 1601 7f01 0701
0000060 1c01 7f01 1c01 7f01 0701 0e01 1601 0a01
0000070 0301 0801 1501 0201 1d01 0301 1d01 1901
0000080 0301 1b01 0c01 1f01 0801 0d01 1d01 0601
0000090 0801 1a01 1901 7f01 1201 1001 0b01 0501
00000a0 0101 0a01 1901 1d01 1301 1c01 1f01 0f01
00000b0 0d01 0201 0301 1a01 0301 0101 1201 1901
00000c0 0301 1d01 0901 1b01 0101 0b01 1701 0601
00000d0 7f01 0901 0801 1501 0b01 1701 1901 0d01
00000e0 1101 1701 0101 1501 0701 0101 1701 0101
00000f0 0c01 1801 0a01 1e01 0101 1001 0301 1401
0000100 0501 0d01 1b01 0701 1f01 0000 0001 0001
000010f
step3. send the query to named
Send this query to named, and it will trigger an assersion failure.
What is the current bug behavior?
07-Sep-2023 18:06:22.485 name.c:692: ENSURE(name->labels <= 127) failed, back trace
07-Sep-2023 18:06:22.485 /home/ubuntu/bind9/lib/isc/.libs/libisc-9.19.12-dev.so(isc_backtrace+0x80) [0x7f340e1dae20]
07-Sep-2023 18:06:22.485 /home/ubuntu/bind9/bin/named/.libs/named() [0x53bcaa]
07-Sep-2023 18:06:22.485 /home/ubuntu/bind9/lib/isc/.libs/libisc-9.19.12-dev.so(isc_assertion_failed+0x57) [0x7f340e1da4b7]
07-Sep-2023 18:06:22.485 /home/ubuntu/bind9/lib/dns/.libs/libdns-9.19.12-dev.so(+0x2d51fc) [0x7f340d95d1fc]
07-Sep-2023 18:06:22.485 /home/ubuntu/bind9/lib/ns/.libs/libns-9.19.12-dev.so(+0x64702) [0x7f340d3c7702]
07-Sep-2023 18:06:22.485 /home/ubuntu/bind9/lib/ns/.libs/libns-9.19.12-dev.so(ns__query_start+0xb7d) [0x7f340d3c1abd]
07-Sep-2023 18:06:22.485 /home/ubuntu/bind9/lib/ns/.libs/libns-9.19.12-dev.so(+0x75b84) [0x7f340d3d8b84]
07-Sep-2023 18:06:22.485 /home/ubuntu/bind9/lib/ns/.libs/libns-9.19.12-dev.so(ns_query_start+0x2274) [0x7f340d3d79a4]
07-Sep-2023 18:06:22.485 /home/ubuntu/bind9/lib/ns/.libs/libns-9.19.12-dev.so(ns__client_request+0x2abb) [0x7f340d39d7cb]
07-Sep-2023 18:06:22.485 /home/ubuntu/bind9/lib/isc/.libs/libisc-9.19.12-dev.so(isc__nm_readcb+0x510) [0x7f340e195530]
07-Sep-2023 18:06:22.485 /home/ubuntu/bind9/lib/isc/.libs/libisc-9.19.12-dev.so(isc__nm_udp_read_cb+0x9fc) [0x7f340e1d440c]
07-Sep-2023 18:06:22.485 /usr/local/lib/libuv.so.1(+0x1dff3) [0x7f340c14dff3]
07-Sep-2023 18:06:22.485 /usr/local/lib/libuv.so.1(+0x1ef4b) [0x7f340c14ef4b]
07-Sep-2023 18:06:22.485 /usr/local/lib/libuv.so.1(+0x22a0c) [0x7f340c152a0c]
07-Sep-2023 18:06:22.485 /usr/local/lib/libuv.so.1(uv_run+0xc0) [0x7f340c13fbd0]
07-Sep-2023 18:06:22.485 /home/ubuntu/bind9/lib/isc/.libs/libisc-9.19.12-dev.so(+0x1091e7) [0x7f340e2331e7]
07-Sep-2023 18:06:22.485 /home/ubuntu/bind9/lib/isc/.libs/libisc-9.19.12-dev.so(isc__trampoline_run+0x74) [0x7f340e28ca94]
07-Sep-2023 18:06:22.485 /lib/x86_64-linux-gnu/libpthread.so.0(+0x76ba) [0x7f340b8da6ba]
07-Sep-2023 18:06:22.485 /lib/x86_64-linux-gnu/libc.so.6(clone+0x6d) [0x7f340aee751d]
07-Sep-2023 18:06:22.485 exiting (due to assertion failure)
What is the expected correct behavior?
The assertion is not supposed to be failed.