[ldns-users] problem reading broken zonefile, possibly a memory bug

Erik P. Ostlyngen erik.ostlyngen at uninett.no
Thu Aug 8 08:04:03 UTC 2013


Hi,

When I try to read a broken zonefile with ldns, the function
ldns_zone_new_frm_fp_l aborts in a way that might indicate some buggy
memory handling. I'm using ldns-1.6.16 on a Linux 3.2.0, 64 bit x86
SMP (Ubuntu 12.04). The library was configured and built with default
settings.

My broken zonefile looks like this:
$TTL 4500
$ORIGIN broken.org.

myzone.org. 1000 IN SOA (
            ldns.myzone.org.
            ns.ldns.myzone.org.
            2012113030
            12345
            1827
            2345678
            87654

hei
hei
hei
hei
(... last line repeated 4000 times)

Note that a ')' is missing at the end of the SOA record. Output from
the example program ldns-read-zone:

ldns_download/ldns-1.6.16/examples$ ./ldns-read-zone broken.org
*** glibc detected ***
/home/erik/ldns_download/ldns-1.6.16/examples/.libs/lt-ldns-read-zone:
double free or corruption (!prev): 0x000000000238a290 ***
======= Backtrace: =========
/lib/x86_64-linux-gnu/libc.so.6(+0x7eb96)[0x7f60d4c09b96]
/home/erik/ldns_download/ldns-1.6.16/.libs/libldns.so.1(ldns_rr_new_frm_fp_l+0x160)[0x7f60d4f83d20]
/home/erik/ldns_download/ldns-1.6.16/.libs/libldns.so.1(ldns_zone_new_frm_fp_l+0xb8)[0x7f60d4f8c638]
/home/erik/ldns_download/ldns-1.6.16/examples/.libs/lt-ldns-read-zone[0x40145a]
/lib/x86_64-linux-gnu/libc.so.6(__libc_start_main+0xed)[0x7f60d4bac76d]
/home/erik/ldns_download/ldns-1.6.16/examples/.libs/lt-ldns-read-zone[0x401781]
======= Memory map: ========
00400000-00403000 r-xp 00000000 fc:00 675055
   /home/erik/ldns_download/ldns-1.6.16/examples/.libs/lt-ldns-read-zone
00602000-00603000 r--p 00002000 fc:00 675055
   /home/erik/ldns_download/ldns-1.6.16/examples/.libs/lt-ldns-read-zone
00603000-00604000 rw-p 00003000 fc:00 675055
   /home/erik/ldns_download/ldns-1.6.16/examples/.libs/lt-ldns-read-zone
0238a000-023ab000 rw-p 00000000 00:00 0
   [heap]
7f60d4192000-7f60d41a7000 r-xp 00000000 fc:00 390968
   /lib/x86_64-linux-gnu/libgcc_s.so.1
7f60d41a7000-7f60d43a6000 ---p 00015000 fc:00 390968
   /lib/x86_64-linux-gnu/libgcc_s.so.1
7f60d43a6000-7f60d43a7000 r--p 00014000 fc:00 390968
   /lib/x86_64-linux-gnu/libgcc_s.so.1
7f60d43a7000-7f60d43a8000 rw-p 00015000 fc:00 390968
   /lib/x86_64-linux-gnu/libgcc_s.so.1
7f60d43a8000-7f60d43be000 r-xp 00000000 fc:00 391143
   /lib/x86_64-linux-gnu/libz.so.1.2.3.4
7f60d43be000-7f60d45bd000 ---p 00016000 fc:00 391143
   /lib/x86_64-linux-gnu/libz.so.1.2.3.4
7f60d45bd000-7f60d45be000 r--p 00015000 fc:00 391143
   /lib/x86_64-linux-gnu/libz.so.1.2.3.4
7f60d45be000-7f60d45bf000 rw-p 00016000 fc:00 391143
   /lib/x86_64-linux-gnu/libz.so.1.2.3.4
7f60d45bf000-7f60d45c1000 r-xp 00000000 fc:00 391094
   /lib/x86_64-linux-gnu/libdl-2.15.so
7f60d45c1000-7f60d47c1000 ---p 00002000 fc:00 391094
   /lib/x86_64-linux-gnu/libdl-2.15.so
7f60d47c1000-7f60d47c2000 r--p 00002000 fc:00 391094
   /lib/x86_64-linux-gnu/libdl-2.15.so
7f60d47c2000-7f60d47c3000 rw-p 00003000 fc:00 391094
   /lib/x86_64-linux-gnu/libdl-2.15.so
7f60d47c3000-7f60d4962000 r-xp 00000000 fc:00 408958
   /lib/x86_64-linux-gnu/libcrypto.so.1.0.0
7f60d4962000-7f60d4b61000 ---p 0019f000 fc:00 408958
   /lib/x86_64-linux-gnu/libcrypto.so.1.0.0
7f60d4b61000-7f60d4b7c000 r--p 0019e000 fc:00 408958
   /lib/x86_64-linux-gnu/libcrypto.so.1.0.0
7f60d4b7c000-7f60d4b87000 rw-p 001b9000 fc:00 408958
   /lib/x86_64-linux-gnu/libcrypto.so.1.0.0
7f60d4b87000-7f60d4b8b000 rw-p 00000000 00:00 0
7f60d4b8b000-7f60d4d40000 r-xp 00000000 fc:00 391095
   /lib/x86_64-linux-gnu/libc-2.15.so
7f60d4d40000-7f60d4f3f000 ---p 001b5000 fc:00 391095
   /lib/x86_64-linux-gnu/libc-2.15.so
7f60d4f3f000-7f60d4f43000 r--p 001b4000 fc:00 391095
   /lib/x86_64-linux-gnu/libc-2.15.so
7f60d4f43000-7f60d4f45000 rw-p 001b8000 fc:00 391095
   /lib/x86_64-linux-gnu/libc-2.15.so
7f60d4f45000-7f60d4f4a000 rw-p 00000000 00:00 0
7f60d4f4a000-7f60d4f9c000 r-xp 00000000 fc:00 528909
   /home/erik/ldns_download/ldns-1.6.16/.libs/libldns.so.1.6.16
7f60d4f9c000-7f60d519b000 ---p 00052000 fc:00 528909
   /home/erik/ldns_download/ldns-1.6.16/.libs/libldns.so.1.6.16
7f60d519b000-7f60d519c000 r--p 00051000 fc:00 528909
   /home/erik/ldns_download/ldns-1.6.16/.libs/libldns.so.1.6.16
7f60d519c000-7f60d51a2000 rw-p 00052000 fc:00 528909
   /home/erik/ldns_download/ldns-1.6.16/.libs/libldns.so.1.6.16
7f60d51a2000-7f60d51c4000 r-xp 00000000 fc:00 391112
   /lib/x86_64-linux-gnu/ld-2.15.so
7f60d53b7000-7f60d53bb000 rw-p 00000000 00:00 0
7f60d53c0000-7f60d53c4000 rw-p 00000000 00:00 0
7f60d53c4000-7f60d53c5000 r--p 00022000 fc:00 391112
   /lib/x86_64-linux-gnu/ld-2.15.so
7f60d53c5000-7f60d53c7000 rw-p 00023000 fc:00 391112
   /lib/x86_64-linux-gnu/ld-2.15.so
7fff6e0ce000-7fff6e0ef000 rw-p 00000000 00:00 0
   [stack]
7fff6e0ef000-7fff6e0f0000 r-xp 00000000 00:00 0
   [vdso]
ffffffffff600000-ffffffffff601000 r-xp 00000000 00:00 0
   [vsyscall]
Aborted


Regards,
Erik Østlyngen
UNINETT Norid



More information about the ldns-users mailing list