Compare commits

...

3 Commits

Author SHA1 Message Date
Mark Andrews
e94d8db1ad 9.10.0-P1 2014-05-05 10:15:51 +10:00
Mark Andrews
42a2c4a9bc 3837. [security] A NULL pointer is passed to query_prefetch resulting
a REQUIRE assertion failure when a fetch is actually
                        initiated.  [ RT #35899]

Squashed commit of the following:

commit 7f4e1f3917d743089c42cc52ec2c0eea598d2c00
Author: Mukund Sivaraman <muks@isc.org>
Date:   Sun May 4 22:34:34 2014 +0530

    Fix a comment

commit 6a35a6a2346013fa8e3798b9b680d8a3031fcb03
Author: Mark Andrews <marka@isc.org>
Date:   Sun May 4 23:34:25 2014 +1000

    pass the correct name to query_prefetch

(cherry picked from commit b36fc8294e)

Conflicts:
	CHANGES
2014-05-05 10:14:13 +10:00
Evan Hunt
63fbb3ea39 [v9_10_0_release] SIT/max-cache-size flag collision
3824.	[bug]		A collision between two flag values could cause
			problems with cache cleaning when SIT was enabled.
			[RT #35858]

(cherry picked from commit e01fbe2a45)
2014-04-28 12:18:53 -07:00
7 changed files with 43 additions and 7 deletions

10
CHANGES
View File

@@ -1,5 +1,15 @@
--- 9.10.0-P1 released ---
3837. [security] A NULL pointer is passed to query_prefetch resulting
a REQUIRE assertion failure when a fetch is actually
initiated. [ RT #35899]
--- 9.10.0 released ---
3824. [bug] A collision between two flag values could cause
problems with cache cleaning when SIT was enabled.
[RT #35858]
--- 9.10.0rc2 released ---
3817. [func] The "delve" command is now spelled "delv" to avoid

View File

@@ -7642,8 +7642,11 @@ query_find(ns_client_t *client, dns_fetchevent_t *event, dns_rdatatype_t qtype)
if (rpz_st != NULL)
rdataset->ttl = ISC_MIN(rdataset->ttl,
rpz_st->m.ttl);
if (!is_zone && RECURSIONOK(client))
query_prefetch(client, fname, rdataset);
if (!is_zone && RECURSIONOK(client)) {
dns_name_t *name;
name = (fname != NULL) ? fname : tname;
query_prefetch(client, name, rdataset);
}
query_addrrset(client,
fname != NULL ? &fname : &tname,
&rdataset, NULL,

View File

@@ -25,3 +25,6 @@ $TTL 300
@ NS ns.tld.
ns A 10.53.0.4
fetch 10 TXT A short ttl
fetchall 10 TXT A short ttl
fetchall 10 A 1.2.3.4
fetchall 10 AAAA ::1

View File

@@ -458,5 +458,21 @@ test ${ttl:-0} -eq ${ttl1:-1} || ret=1
if [ $ret != 0 ]; then echo "I:failed"; fi
status=`expr $status + $ret`
n=`expr $n + 1`
echo "I:check prefetch qtype * (${n})"
ret=0
$DIG @10.53.0.5 -p 5300 fetchall.tld any > dig.out.1.${n} || ret=1
ttl1=`awk '/"A" "short" "ttl"/ { print $2 - 2 }' dig.out.1.${n}`
# sleep so we are in prefetch range
sleep ${ttl1:-0}
# trigger prefetch
$DIG @10.53.0.5 -p 5300 fetchall.tld any > dig.out.2.${n} || ret=1
ttl2=`awk '/"A" "short" "ttl"/ { print $2 }' dig.out.2.${n}`
sleep 1
# check that the nameserver is still alive
$DIG @10.53.0.5 -p 5300 fetchall.tld any > dig.out.3.${n} || ret=1
if [ $ret != 0 ]; then echo "I:failed"; fi
status=`expr $status + $ret`
echo "I:exit status: $status"
exit $status

View File

@@ -357,7 +357,7 @@ static void dump_entry(FILE *, dns_adbentry_t *, isc_boolean_t, isc_stdtime_t);
* Private flag(s) for entries.
* MUST NOT overlap FCTX_ADDRINFO_xxx and DNS_FETCHOPT_NOEDNS0.
*/
#define ENTRY_IS_DEAD 0x80000000
#define ENTRY_IS_DEAD 0x00400000
/*
* To the name, address classes are all that really exist. If it has a
@@ -4041,6 +4041,9 @@ dns_adb_changeflags(dns_adb_t *adb, dns_adbaddrinfo_t *addr,
REQUIRE(DNS_ADB_VALID(adb));
REQUIRE(DNS_ADBADDRINFO_VALID(addr));
REQUIRE((bits & ENTRY_IS_DEAD) == 0);
REQUIRE((mask & ENTRY_IS_DEAD) == 0);
bucket = addr->entry->lock_bucket;
LOCK(&adb->entrylocks[bucket]);

View File

@@ -95,10 +95,11 @@ typedef struct dns_fetchevent {
#define DNS_FETCHOPT_NOVALIDATE 0x020 /*%< Disable validation. */
#define DNS_FETCHOPT_EDNS512 0x040 /*%< Advertise a 512 byte
UDP buffer. */
#define DNS_FETCHOPT_WANTNSID 0x080 /*%< Request NSID */
#define DNS_FETCHOPT_PREFETCH 0x100 /*%< Request NSID */
#define DNS_FETCHOPT_WANTNSID 0x080 /*%< Request NSID */
#define DNS_FETCHOPT_PREFETCH 0x100 /*%< Do prefetch */
#define DNS_FETCHOPT_NOCDFLAG 0x200 /*%< Don't set CD flag. */
/* Reserved in use by adb.c 0x00400000 */
#define DNS_FETCHOPT_EDNSVERSIONSET 0x00800000
#define DNS_FETCHOPT_EDNSVERSIONMASK 0xff000000
#define DNS_FETCHOPT_EDNSVERSIONSHIFT 24

View File

@@ -6,6 +6,6 @@ DESCRIPTION=
MAJORVER=9
MINORVER=10
PATCHVER=0
RELEASETYPE=
RELEASEVER=
RELEASETYPE=-P
RELEASEVER=1
EXTENSIONS=