Bug 32380

Summary: 'named' coredumps when AD DNS Zone driver is enabled
Product: Mageia Reporter: Kim Pedersen <kim>
Component: RPM PackagesAssignee: All Packagers <pkg-bugs>
Status: NEW --- QA Contact:
Severity: major    
Priority: Normal    
Version: 9   
Target Milestone: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Source RPM: bind-9.18.15-2.mga9.src.rpm CVE:
Status comment:

Description Kim Pedersen 2023-10-12 19:33:28 CEST
Description of problem:

We have a system that runs samba-dc and bind9 with Samba AD/DNS integration enabled. 
Bind9 will no longer start after upgrade from Mageia 8 to Mageia 9.

Running the named executable in foreground (/usr/sbin/named -u named -c /etc/named.conf -g) on console shows a coredump with the following output:

--
12-Oct-2023 12:35:34.031 starting BIND 9.18.19 (Extended Support Version) <id:>
12-Oct-2023 12:35:34.031 running on Linux x86_64 5.10.46-server-1.mga7 #1 SMP Thu Jun 24 15:14:21 UTC 2021
12-Oct-2023 12:35:34.031 built with  '--host=x86_64-mageia-linux-gnu' '--build=x86_64-mageia-linux-gnu' '--program-prefix=' '--disable-dependency-tracking' '--prefix=/usr' '--exec-prefix=/usr' '--bindir=/usr/bin' '--sbindir=/usr/sbin' '--sysconfdir=/etc' '--datadir=/usr/share' '--includedir=/usr/include' '--libdir=/usr/lib64' '--libexecdir=/usr/libexec' '--sharedstatedir=/var/lib' '--mandir=/usr/share/man' '--infodir=/usr/share/info' '--localstatedir=/var' '--with-pic' '--disable-static' '--includedir=/usr/include/bind9' '--with-tuning=large' '--with-libidn2' '--with-maxminddb' '--with-gssapi=yes' '--with-lmdb=yes' '--with-json-c' '--with-cmocka' '--enable-fixed-rrset' '--enable-full-report' 'build_alias=x86_64-mageia-linux-gnu' 'host_alias=x86_64-mageia-linux-gnu' 'CFLAGS=-O2 -g -pipe -Wformat -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -fstack-protector --param=ssp-buffer-size=4 -fstack-protector-all -fasynchronous-unwind-tables -O2 -g -pipe -Wformat -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -fstack-protector --param=ssp-buffer-size=4 -fstack-protector-all -fasynchronous-unwind-tables' 'LDFLAGS= -Wl,--as-needed -Wl,-z,relro -Wl,-O1 -Wl,--build-id=sha1 -Wl,--enable-new-dtags' 'LT_SYS_LIBRARY_PATH=/usr/lib64:' 'PKG_CONFIG_PATH=:/usr/lib64/pkgconfig:/usr/share/pkgconfig'
12-Oct-2023 12:35:34.031 running as: named -u named -c /etc/named.conf -g
12-Oct-2023 12:35:34.031 compiled by GCC 12.3.0
12-Oct-2023 12:35:34.031 compiled with OpenSSL version: OpenSSL 3.0.10 1 Aug 2023
12-Oct-2023 12:35:34.031 linked to OpenSSL version: OpenSSL 3.0.10 1 Aug 2023
12-Oct-2023 12:35:34.031 compiled with libuv version: 1.44.2
12-Oct-2023 12:35:34.031 linked to libuv version: 1.44.2
12-Oct-2023 12:35:34.031 compiled with libxml2 version: 2.10.4
12-Oct-2023 12:35:34.031 linked to libxml2 version: 21004
12-Oct-2023 12:35:34.031 compiled with json-c version: 0.16
12-Oct-2023 12:35:34.031 linked to json-c version: 0.16
12-Oct-2023 12:35:34.031 compiled with zlib version: 1.2.13
12-Oct-2023 12:35:34.031 linked to zlib version: 1.2.13
12-Oct-2023 12:35:34.031 ----------------------------------------------------
12-Oct-2023 12:35:34.031 BIND 9 is maintained by Internet Systems Consortium,
12-Oct-2023 12:35:34.031 Inc. (ISC), a non-profit 501(c)(3) public-benefit
12-Oct-2023 12:35:34.031 corporation.  Support and training for BIND 9 are
12-Oct-2023 12:35:34.031 available at https://www.isc.org/support
12-Oct-2023 12:35:34.031 ----------------------------------------------------
12-Oct-2023 12:35:34.031 adjusted limit on open files from 524288 to 1048576
12-Oct-2023 12:35:34.031 found 4 CPUs, using 4 worker threads
12-Oct-2023 12:35:34.031 using 4 UDP listeners per interface
12-Oct-2023 12:35:34.031 DNSSEC algorithms: RSASHA1 NSEC3RSASHA1 RSASHA256 RSASHA512 ECDSAP256SHA256 ECDSAP384SHA384 ED25519 ED448
12-Oct-2023 12:35:34.031 DS algorithms: SHA-1 SHA-256 SHA-384
12-Oct-2023 12:35:34.031 HMAC algorithms: HMAC-MD5 HMAC-SHA1 HMAC-SHA224 HMAC-SHA256 HMAC-SHA384 HMAC-SHA512
12-Oct-2023 12:35:34.031 TKEY mode 2 support (Diffie-Hellman): yes
12-Oct-2023 12:35:34.031 TKEY mode 3 support (GSS-API): yes
12-Oct-2023 12:35:34.031 ../../../bin/named/config.c: option 'trust-anchor-telemetry' is experimental and subject to change in the future
12-Oct-2023 12:35:34.031 loading configuration from '/etc/named.conf'
12-Oct-2023 12:35:34.031 unable to open '/etc/named.iscdlv.key'; using built-in keys instead
12-Oct-2023 12:35:34.031 looking for GeoIP2 databases in '/usr/share/GeoIP'
12-Oct-2023 12:35:34.031 using default UDP/IPv4 port range: [32768, 60999]
12-Oct-2023 12:35:34.031 using default UDP/IPv6 port range: [32768, 60999]
12-Oct-2023 12:35:34.031 listening on IPv4 interface lo, 127.0.0.1#53
12-Oct-2023 12:35:34.031 listening on IPv4 interface eno1, 192.168.0.2#53
12-Oct-2023 12:35:34.031 listening on IPv6 interface lo, ::1#53
12-Oct-2023 12:35:34.031 generating session key for dynamic DNS
12-Oct-2023 12:35:34.031 sizing zone task pool based on 8 zones
12-Oct-2023 12:35:34.031 Loading 'AD DNS Zone' using driver dlopen
munmap_chunk(): invalid pointer
Aborted (core dumped)
--

The issue happens when named tries to load the corresponding DLZ module. If I comment out the DLZ reference in the named configuration files, then named starts fine, but the AD integration obviously doesn't activate.

I use the following line in named.conf to load the correct dlz:
database "dlopen /usr/lib64/samba/bind9/dlz_bind9_18.so";

I compiled the SRPMs for bind and samba and use the executables and DLZ modules from these recompiled packages to rule out it was some odd compiler glitch in the distribution.

I have also compiled bind and samba from the Cauldron/mga10 repositories with same result - core dump when launching named and trying to use the dlz_bind9_18.so module.

Version-Release number of selected component (if applicable):


How reproducible:
We only have one system with this configuration, but it's been reproducible across different versions of the binaries.

Steps to Reproduce:
1. Run samba-dc and bind9/named with DNS integration enabled
2. Check whether named core dumps or runs successfully.
Kim Pedersen 2023-10-12 19:34:56 CEST

Summary: named coredumps when AD DNS Zone driver is enable => named coredumps when AD DNS Zone driver is enabled

Comment 1 Lewis Smith 2023-10-12 20:32:49 CEST
Thank you for this report, and all your investigations.
Apologies for your angst.

Assigning this globally as different packagers commit bind.

Summary: named coredumps when AD DNS Zone driver is enabled => 'named' coredumps when AD DNS Zone driver is enabled
Assignee: bugsquad => pkg-bugs

Comment 2 Kim Pedersen 2024-01-11 21:44:29 CET
Hi Lewis,

Just wanted to check in on this issue.

I checked the changelogs of the current packages for named 9.18.15-2.2.mga9 and samba 4.17.12-1.mga9, but don't see anything that looks to be of relevance.

Having assigned it globally, can you point me in the direction of the bind/named package?
Comment 3 Kim Pedersen 2024-06-06 16:28:36 CEST
Hi Lewis, 

Checking in again, having assigned it globally, can you point me in the direction of the bind/named package?