From 9181e8a0568c37432676bd00b4bdb0dfdabfd6c1 Mon Sep 17 00:00:00 2001 From: Mark Andrews Date: Tue, 7 Feb 2012 00:19:45 +0000 Subject: [PATCH 1/7] rt27739: make ixfr test more robust --- bin/tests/system/ixfr/clean.sh | 3 ++- bin/tests/system/ixfr/setup.sh | 4 ++-- bin/tests/system/ixfr/tests.sh | 26 ++++++++++++++++++++++---- 3 files changed, 26 insertions(+), 7 deletions(-) diff --git a/bin/tests/system/ixfr/clean.sh b/bin/tests/system/ixfr/clean.sh index 50d763d307..b44f86c1cb 100644 --- a/bin/tests/system/ixfr/clean.sh +++ b/bin/tests/system/ixfr/clean.sh @@ -15,9 +15,10 @@ # OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR # PERFORMANCE OF THIS SOFTWARE. -# $Id: clean.sh,v 1.8 2011/09/06 23:46:27 tbox Exp $ +# $Id: clean.sh,v 1.9 2012/02/07 00:19:45 marka Exp $ rm -f ns1/named.conf ns1/myftp.db rm -f ns3/*.jnl ns3/mytest.db ns3/subtest.db rm -f ns4/*.jnl ns4/*.db rm -f */named.memstats +rm -f dig.out diff --git a/bin/tests/system/ixfr/setup.sh b/bin/tests/system/ixfr/setup.sh index c965da98f0..6cbcb8bdf1 100644 --- a/bin/tests/system/ixfr/setup.sh +++ b/bin/tests/system/ixfr/setup.sh @@ -15,9 +15,9 @@ # OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR # PERFORMANCE OF THIS SOFTWARE. -# $Id: setup.sh,v 1.6 2011/09/06 23:46:27 tbox Exp $ +# $Id: setup.sh,v 1.7 2012/02/07 00:19:45 marka Exp $ -rm -f ns1/*.db ns1/*.jnl ns3/*.jnl ns4/*.jnl +rm -f ns1/*.db ns1/*.jnl ns3/*.jnl ns4/*.db ns4/*.jnl cat <ns1/named.conf options { diff --git a/bin/tests/system/ixfr/tests.sh b/bin/tests/system/ixfr/tests.sh index a3e8f36d40..ecedbb4a59 100644 --- a/bin/tests/system/ixfr/tests.sh +++ b/bin/tests/system/ixfr/tests.sh @@ -15,7 +15,7 @@ # OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR # PERFORMANCE OF THIS SOFTWARE. -# $Id: tests.sh,v 1.8 2011/09/06 22:29:32 smann Exp $ +# $Id: tests.sh,v 1.9 2012/02/07 00:19:45 marka Exp $ # WARNING: The test labelled "testing request-ixfr option in view vs zone" @@ -153,7 +153,13 @@ fi cp ns3/mytest1.db ns3/mytest.db $RNDC -s 10.53.0.3 -p 9953 -c ../common/rndc.conf reload -sleep 2 + +for i in 0 1 2 3 4 5 6 7 8 9 +do + $DIG +tcp -p 5300 @10.53.0.4 SOA test > dig.out + grep -i "hostmaster\.test\..2" dig.out > /dev/null && break + sleep 1 +done # slave should have gotten notify and updated @@ -173,7 +179,13 @@ echo "I:testing request-ixfr option in view vs zone" echo "I: this result should be AXFR" cp ns3/subtest1.db ns3/subtest.db # change to sub.test zone, should be AXFR $RNDC -s 10.53.0.3 -p 9953 -c ../common/rndc.conf reload -sleep 2 + +for i in 0 1 2 3 4 5 6 7 8 9 +do + $DIG +tcp -p 5300 @10.53.0.4 SOA sub.test > dig.out + grep -i "hostmaster\.test\..3" dig.out > /dev/null && break + sleep 1 +done echo "I: this result should be AXFR" NONINCR=`grep 'sub\.test/IN/primary' ns4/named.run|grep "got nonincremental" | wc -l` @@ -188,7 +200,13 @@ fi echo "I: this result should be IXFR" cp ns3/mytest2.db ns3/mytest.db # change to test zone, should be IXFR $RNDC -s 10.53.0.3 -p 9953 -c ../common/rndc.conf reload -sleep 2 + +for i in 0 1 2 3 4 5 6 7 8 9 +do + $DIG +tcp -p 5300 @10.53.0.4 SOA test > dig.out + grep -i "hostmaster\.test\..4" dig.out > /dev/null && break + sleep 1 +done INCR=`grep "test/IN/primary" ns4/named.run|grep "got incremental"|wc -l` if [ $INCR -ne 2 ] From a0c0b325b7d098e5f06d05414fcbb94346bdb527 Mon Sep 17 00:00:00 2001 From: Automatic Updater Date: Tue, 7 Feb 2012 00:21:51 +0000 Subject: [PATCH 2/7] update --- doc/private/SRCID | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/doc/private/SRCID b/doc/private/SRCID index 3c9e2a8081..a6fa3208de 100644 --- a/doc/private/SRCID +++ b/doc/private/SRCID @@ -1,6 +1,6 @@ -# $Id: SRCID,v 1.1182 2012/02/06 22:16:59 tbox Exp $ +# $Id: SRCID,v 1.1183 2012/02/07 00:21:51 tbox Exp $ # # This file must follow /bin/sh rules. It is imported directly via # configure. # -SRCID="( $Date: 2012/02/06 22:16:59 $ )" +SRCID="( $Date: 2012/02/07 00:21:51 $ )" From f4bd753e0bdc7a9dc6c00be8aa04e114625a6402 Mon Sep 17 00:00:00 2001 From: Evan Hunt Date: Tue, 7 Feb 2012 00:33:19 +0000 Subject: [PATCH 3/7] fixed a test error that caused autosign to fail on freebsd --- bin/tests/system/autosign/tests.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/bin/tests/system/autosign/tests.sh b/bin/tests/system/autosign/tests.sh index 0d4f953023..adb97b4b8f 100644 --- a/bin/tests/system/autosign/tests.sh +++ b/bin/tests/system/autosign/tests.sh @@ -14,7 +14,7 @@ # OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR # PERFORMANCE OF THIS SOFTWARE. -# $Id: tests.sh,v 1.45 2012/02/06 21:33:50 each Exp $ +# $Id: tests.sh,v 1.46 2012/02/07 00:33:19 each Exp $ SYSTEMTESTTOP=.. . $SYSTEMTESTTOP/conf.sh @@ -1122,7 +1122,7 @@ ret=0 rm -f ns3/*.nzf $RNDC -c ../common/rndc.conf -s 10.53.0.3 -p 9953 addzone reconf.example '{ type master; file "reconf.example.db"; };' 2>&1 | sed 's/^/I:ns3 /' rekey_calls=`grep "zone reconf.example.*next key event" ns3/named.run | wc -l` -[ "$rekey_calls" = 0 ] || ret=1 +[ "$rekey_calls" -eq 0 ] || ret=1 # ...then we add auto-dnssec and reconfigure nzf=`ls ns3/*.nzf` echo 'zone reconf.example { type master; file "reconf.example.db"; allow-update { any; }; auto-dnssec maintain; };' > $nzf From fc3b3e1f7e4ec1cf3bcc08f7ecc3ed8ebd29b034 Mon Sep 17 00:00:00 2001 From: Mark Andrews Date: Tue, 7 Feb 2012 00:47:21 +0000 Subject: [PATCH 4/7] 3278. [bug] Hold a internal reference to the zone while performing a asynchronous load. Address potential memory leak if the asynchronous is cancelled. [RT #27750] --- CHANGES | 6 +++++- lib/dns/zone.c | 9 ++++++--- 2 files changed, 11 insertions(+), 4 deletions(-) diff --git a/CHANGES b/CHANGES index 483d8db322..8922806565 100644 --- a/CHANGES +++ b/CHANGES @@ -1,3 +1,7 @@ +3278. [bug] Hold a internal reference to the zone while performing + a asynchronous load. Address potential memory leak + if the asynchronous is cancelled. [RT #27750] + 3277. [bug] Make sure automatic key maintenance is started when "auto-dnssec maintain" is turned on during "rndc reconfig". [RT #26805] @@ -8,7 +12,7 @@ safe_open failure. [RT #27696] 3275. [bug] Corrected rndc -h output; the 'rndc sync -clean' - option had been missplled as '-clear'. (To avoid + option had been misspelled as '-clear'. (To avoid future confusion, both options now work.) [RT #27173] 3274. [placeholder] diff --git a/lib/dns/zone.c b/lib/dns/zone.c index c9f6f8d73c..3e8b1ef212 100644 --- a/lib/dns/zone.c +++ b/lib/dns/zone.c @@ -15,7 +15,7 @@ * PERFORMANCE OF THIS SOFTWARE. */ -/* $Id: zone.c,v 1.671 2012/02/03 12:59:03 marka Exp $ */ +/* $Id: zone.c,v 1.672 2012/02/07 00:47:21 marka Exp $ */ /*! \file */ @@ -1711,7 +1711,7 @@ zone_asyncload(isc_task_t *task, isc_event_t *event) { isc_event_free(&event); if (result == ISC_R_CANCELED || !DNS_ZONE_FLAG(zone, DNS_ZONEFLG_LOADPENDING)) - return; + goto cleanup; zone_load(zone, 0); @@ -1723,7 +1723,9 @@ zone_asyncload(isc_task_t *task, isc_event_t *event) { if (asl->loaded != NULL) (asl->loaded)(asl->loaded_arg, zone, task); + cleanup: isc_mem_put(zone->mctx, asl, sizeof (*asl)); + dns_zone_idetach(&zone); } isc_result_t @@ -1741,7 +1743,7 @@ dns_zone_asyncload(dns_zone_t *zone, dns_zt_zoneloaded_t done, void *arg) { if (asl == NULL) CHECK(ISC_R_NOMEMORY); - asl->zone = zone; + asl->zone = NULL; asl->loaded = done; asl->loaded_arg = arg; @@ -1753,6 +1755,7 @@ dns_zone_asyncload(dns_zone_t *zone, dns_zt_zoneloaded_t done, void *arg) { CHECK(ISC_R_NOMEMORY); LOCK_ZONE(zone); + zone_iattach(zone, &asl->zone); DNS_ZONE_SETFLAG(zone, DNS_ZONEFLG_LOADPENDING); isc_task_send(zone->loadtask, &e); UNLOCK_ZONE(zone); From 3fd0334e59fe72294bedafc9cb0f74d66b1cfe3a Mon Sep 17 00:00:00 2001 From: Mark Andrews Date: Tue, 7 Feb 2012 00:54:11 +0000 Subject: [PATCH 5/7] changes numbers --- CHANGES | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/CHANGES b/CHANGES index 8922806565..5b4432602d 100644 --- a/CHANGES +++ b/CHANGES @@ -1,12 +1,12 @@ -3278. [bug] Hold a internal reference to the zone while performing +3279. [bug] Hold a internal reference to the zone while performing a asynchronous load. Address potential memory leak if the asynchronous is cancelled. [RT #27750] -3277. [bug] Make sure automatic key maintenance is started +3278. [bug] Make sure automatic key maintenance is started when "auto-dnssec maintain" is turned on during "rndc reconfig". [RT #26805] -3276. [bug] win32: isc_socket_dup is not implemented. [RT #27696] +3277. [bug] win32: isc_socket_dup is not implemented. [RT #27696] 3276. [bug] win32: ns_os_openfile failed to return NULL on safe_open failure. [RT #27696] From 81274f4b08b04eade0936cd32a4ba56281d7c2d2 Mon Sep 17 00:00:00 2001 From: Mark Andrews Date: Tue, 7 Feb 2012 01:07:47 +0000 Subject: [PATCH 6/7] 3280. [bug] Potential double free of a rdataset on out of memory with DNS64. [RT #27762] --- CHANGES | 3 +++ bin/named/query.c | 10 +++++----- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/CHANGES b/CHANGES index 5b4432602d..1d6fee59d3 100644 --- a/CHANGES +++ b/CHANGES @@ -1,3 +1,6 @@ +3280. [bug] Potential double free of a rdataset on out of memory + with DNS64. [RT #27762] + 3279. [bug] Hold a internal reference to the zone while performing a asynchronous load. Address potential memory leak if the asynchronous is cancelled. [RT #27750] diff --git a/bin/named/query.c b/bin/named/query.c index 53aa489b5d..6bae511641 100644 --- a/bin/named/query.c +++ b/bin/named/query.c @@ -15,7 +15,7 @@ * PERFORMANCE OF THIS SOFTWARE. */ -/* $Id: query.c,v 1.383 2012/01/31 23:47:31 tbox Exp $ */ +/* $Id: query.c,v 1.384 2012/02/07 01:07:47 marka Exp $ */ /*! \file */ @@ -6132,6 +6132,8 @@ query_find(ns_client_t *client, dns_fetchevent_t *event, dns_rdatatype_t qtype) query_putrdataset(client, &sigrdataset); rdataset = client->query.dns64_aaaa; sigrdataset = client->query.dns64_sigaaaa; + client->query.dns64_aaaa = NULL; + client->query.dns64_sigaaaa = NULL; if (fname == NULL) { dbuf = query_getnamebuf(client); if (dbuf == NULL) { @@ -6145,8 +6147,6 @@ query_find(ns_client_t *client, dns_fetchevent_t *event, dns_rdatatype_t qtype) } } dns_name_copy(client->query.qname, fname, NULL); - client->query.dns64_aaaa = NULL; - client->query.dns64_sigaaaa = NULL; dns64 = ISC_FALSE; #ifdef dns64_bis_return_excluded_addresses /* @@ -6391,6 +6391,8 @@ query_find(ns_client_t *client, dns_fetchevent_t *event, dns_rdatatype_t qtype) query_putrdataset(client, &sigrdataset); rdataset = client->query.dns64_aaaa; sigrdataset = client->query.dns64_sigaaaa; + client->query.dns64_aaaa = NULL; + client->query.dns64_sigaaaa = NULL; if (fname == NULL) { dbuf = query_getnamebuf(client); if (dbuf == NULL) { @@ -6404,8 +6406,6 @@ query_find(ns_client_t *client, dns_fetchevent_t *event, dns_rdatatype_t qtype) } } dns_name_copy(client->query.qname, fname, NULL); - client->query.dns64_aaaa = NULL; - client->query.dns64_sigaaaa = NULL; dns64 = ISC_FALSE; #ifdef dns64_bis_return_excluded_addresses if (dns64_excluded) From bc3f86f9afb10087fb070016dc3d2e56b1ef0214 Mon Sep 17 00:00:00 2001 From: Automatic Updater Date: Tue, 7 Feb 2012 01:16:32 +0000 Subject: [PATCH 7/7] update --- doc/private/SRCID | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/doc/private/SRCID b/doc/private/SRCID index a6fa3208de..e0b20710fb 100644 --- a/doc/private/SRCID +++ b/doc/private/SRCID @@ -1,6 +1,6 @@ -# $Id: SRCID,v 1.1183 2012/02/07 00:21:51 tbox Exp $ +# $Id: SRCID,v 1.1184 2012/02/07 01:16:32 tbox Exp $ # # This file must follow /bin/sh rules. It is imported directly via # configure. # -SRCID="( $Date: 2012/02/07 00:21:51 $ )" +SRCID="( $Date: 2012/02/07 01:16:32 $ )"