2
0
mirror of https://gitlab.isc.org/isc-projects/bind9 synced 2025-08-28 13:08:06 +00:00

765 Commits

Author SHA1 Message Date
Mark Andrews
2f36a62d16 use RUNTIME_CHECK 2018-10-23 12:15:04 +00:00
Mark Andrews
1a2a19c693 address fctx reference count leaks; style 2018-10-23 12:15:04 +00:00
Witold Kręcicki
f2af336dc4 Fix looping issues 2018-10-23 12:15:04 +00:00
Witold Kręcicki
70a1ba20ec QNAME miminimization should create a separate fetch context for each fetch -
this makes the cache more efficient and eliminates duplicates queries.
2018-10-23 12:15:04 +00:00
Mark Andrews
615ebc39e3 remove EDNS workarounds, update legacy test 2018-08-30 21:17:00 -07:00
Michał Kępień
24b9ec555a Do not treat a referral with a non-empty ANSWER section as an error
As part of resquery_response() refactoring [1], a goto statement was
replaced [2] with a call to a new function - originally called
rctx_delegation(), now folded into rctx_answer_none() - extracted from
existing code.  However, one call site of that refactored function does
not reset the "result" variable, causing a referral with a non-empty
ANSWER section to be inadvertently treated as an error, which prevents
resolution of names reliant on servers sending such responses.  Fix by
resetting the "result" variable to ISC_R_SUCCESS when a response
containing a non-empty ANSWER section can be treated as a delegation.

[1] see RT #45362

[2] see commit e1380a16741a3b4a57e54d7a9ce09dd12691522f
2018-08-22 10:14:37 +02:00
Witold Kręcicki
5cdb38c2c7 Remove unthreaded support 2018-08-16 17:18:52 +02:00
Evan Hunt
3f907b8bee caclulate nlabels and set *chainingp correctly 2018-08-08 14:33:19 -07:00
Evan Hunt
cac3978af2 explicit DNAME query could trigger a crash if deny-answer-aliases was set 2018-08-08 14:33:19 -07:00
Ondřej Surý
994e656977 Replace custom isc_boolean_t with C standard bool type 2018-08-08 09:37:30 +02:00
Ondřej Surý
cb6a185c69 Replace custom isc_u?intNN_t types with C99 u?intNN_t types 2018-08-08 09:37:28 +02:00
Ondřej Surý
64fe6bbaf2 Replace ISC_PRINT_QUADFORMAT with inttypes.h format constants 2018-08-08 09:36:44 +02:00
Evan Hunt
dde66b8012 nits
- capitalize QNAME in the doc
- regenerate options/docbook
- whitespace
2018-06-12 09:20:13 +02:00
Witold Kręcicki
265052df49 qname-minimization: Some post-review style/minor fixes 2018-06-12 09:20:12 +02:00
Witold Kręcicki
058ce1e732 qname minimization: log how many qmin steps were taken 2018-06-12 09:18:47 +02:00
Witold Kręcicki
c04784c144 Disable qname minimization if we encounter a bad server 2018-06-12 09:18:47 +02:00
Evan Hunt
c8015eb33b style nits (mostly line length) 2018-06-12 09:18:47 +02:00
Evan Hunt
2ea47c7f34 rename test to qmin; add it to conf.sh.in and Makefile.in; fix copyrights 2018-06-12 09:18:47 +02:00
Witold Kręcicki
dd7bb617be - qname minimization:
- make qname-minimization option tristate {strict,relaxed,disabled}
 - go straight for the record if we hit NXDOMAIN in relaxed mode
 - go straight for the record after 3 labels without new delegation or 7 labels total

- use start of fetch (and not time of response) as 'now' time for querying cache for
  zonecut when following delegation.
2018-06-12 09:18:46 +02:00
Witold Kręcicki
0698158eb0 QNAME minimization 2018-06-12 09:18:46 +02:00
Witold Kręcicki
cb3208aa43 Don't fetch DNSKEY when fuzzing resolver 2018-06-06 15:06:23 +02:00
Tony Finch
abfbedc0b1 Move NSID logging to its own category
It is very verbose, so it is useful to be able to filter it out.
2018-06-05 12:10:37 +10:00
Ondřej Surý
99ba29bc52 Change isc_random() to be just PRNG, and add isc_nonce_buf() that uses CSPRNG
This commit reverts the previous change to use system provided
entropy, as (SYS_)getrandom is very slow on Linux because it is
a syscall.

The change introduced in this commit adds a new call isc_nonce_buf
that uses CSPRNG from cryptographic library provider to generate
secure data that can be and must be used for generating nonces.
Example usage would be DNS cookies.

The isc_random() API has been changed to use fast PRNG that is not
cryptographically secure, but runs entirely in user space.  Two
contestants have been considered xoroshiro family of the functions
by Villa&Blackman and PCG by O'Neill.  After a consideration the
xoshiro128starstar function has been used as uint32_t random number
provider because it is very fast and has good enough properties
for our usage pattern.

The other change introduced in the commit is the more extensive usage
of isc_random_uniform in places where the usage pattern was
isc_random() % n to prevent modulo bias.  For usage patterns where
only 16 or 8 bits are needed (DNS Message ID), the isc_random()
functions has been renamed to isc_random32(), and isc_random16() and
isc_random8() functions have been introduced by &-ing the
isc_random32() output with 0xffff and 0xff.  Please note that the
functions that uses stripped down bit count doesn't pass our
NIST SP 800-22 based random test.
2018-05-29 22:58:21 +02:00
Evan Hunt
e324449349 remove the experimental authoritative ECS support from named
- mark the 'geoip-use-ecs' option obsolete; warn when it is used
  in named.conf
- prohibit 'ecs' ACL tags in named.conf; note that this is a fatal error
  since simply ignoring the tags could make ACLs behave unpredictably
- re-simplify the radix and iptable code
- clean up dns_acl_match(), dns_aclelement_match(), dns_acl_allowed()
  and dns_geoip_match() so they no longer take ecs options
- remove the ECS-specific unit and system test cases
- remove references to ECS from the ARM
2018-05-25 08:21:25 -07:00
Tony Finch
174cd00290 Fix request-nsid log level to match documentation.
Since change 3741 (commit 1d761cb4) they have been logged at
debug(3) by mistake.
2018-05-16 20:20:05 +01:00
Ondřej Surý
3a4f820d62 Replace all random functions with isc_random, isc_random_buf and isc_random_uniform API.
The three functions has been modeled after the arc4random family of
functions, and they will always return random bytes.

The isc_random family of functions internally use these CSPRNG (if available):

1. getrandom() libc call (might be available on Linux and Solaris)
2. SYS_getrandom syscall (might be available on Linux, detected at runtime)
3. arc4random(), arc4random_buf() and arc4random_uniform() (available on BSDs and Mac OS X)
4. crypto library function:
4a. RAND_bytes in case OpenSSL
4b. pkcs_C_GenerateRandom() in case PKCS#11 library
2018-05-16 09:54:35 +02:00
Ondřej Surý
8bdc23add2 Change ISC_SOCKEVENTATTR_* defines into isc_sockeventattr_t enum 2018-04-12 09:54:24 +02:00
Michał Kępień
4df4a8e731 Use dns_fixedname_initname() where possible
Replace dns_fixedname_init() calls followed by dns_fixedname_name()
calls with calls to dns_fixedname_initname() where it is possible
without affecting current behavior and/or performance.

This patch was mostly prepared using Coccinelle and the following
semantic patch:

    @@
    expression fixedname, name;
    @@
    -	dns_fixedname_init(&fixedname);
    	...
    -	name = dns_fixedname_name(&fixedname);
    +	name = dns_fixedname_initname(&fixedname);

The resulting set of changes was then manually reviewed to exclude false
positives and apply minor tweaks.

It is likely that more occurrences of this pattern can be refactored in
an identical way.  This commit only takes care of the low-hanging fruit.
2018-04-09 12:14:16 +02:00
Witold Kręcicki
102a397e39 libdns refactoring: get rid of multiple versions of dns_keytable_add, dns_iptable_addprefix and dns_iptable_addprefix 2018-04-06 08:04:41 +02:00
Witold Kręcicki
c8aa1ee9e6 libdns refactoring: get rid of multiple versions of dns_dt_create, dns_view_setcache, dns_zt_apply, dns_message_logfmtpacket, dns_message_logpacket, dns_ssutable_checkrules and dns_ttl_totext 2018-04-06 08:04:41 +02:00
Witold Kręcicki
d54d482af0 libdns refactoring: get rid of multiple versions of dns_view_find, dns_view_findzonecut and dns_view_flushcache 2018-04-06 08:04:41 +02:00
Witold Kręcicki
42ee8c853a libdns refactoring: get rid of 3 versions of dns_resolver_createfetch 2018-04-06 08:04:41 +02:00
Witold Kręcicki
e20b702418 libdns refactoring: get rid of multiple versions of dns_dispatch_createtcp and dns_dispatch_addresponse, unify dns_dispatch_gettcp and dns_dispatch_gettcp2 2018-04-06 08:04:41 +02:00
Witold Kręcicki
f0a07b7546 libdns refactoring: get rid of two versions of dns_adb_createfind and dns_adb_probesize 2018-04-06 08:04:41 +02:00
Witold Kręcicki
3687648384 libdns refactoring: get rid of two versions of dns_acl_match and dns_aclelement_match 2018-04-06 08:04:40 +02:00
Mark Andrews
7b27be54ee adjust goto target and conditional compilation so that cleanup_spillattimer and cleanup_alglock labels match the element to be cleanup and so that they are always used 2018-02-24 17:49:49 -08:00
Ondřej Surý
843d389661 Update license headers to not include years in copyright in all applicable files 2018-02-23 10:12:02 +01:00
Ondřej Surý
4801f40e4d Merge branch 'master' into 'master'
Master

See merge request isc-projects/bind9!36
2018-02-16 17:19:26 -05:00
Mark Andrews
b5167607ef make declaration and use of setnocookie fully conditional 2018-02-16 10:20:38 +11:00
Mark Andrews
0f8b0dc5d4 use %u instead of %d 2018-02-16 10:20:38 +11:00
Petr Menšík
e7a93321f0 Reuse new function from rt46864 for similar block elsewhere. 2018-02-15 12:42:33 +01:00
Mark Andrews
8b440753b6 [master] address overflow in retry backoff
4877.	[bug]		Address integer overflow when exponentially
			backing off retry intervals. [RT #47041]
2018-01-24 09:45:01 -08:00
Mark Andrews
fdd8838bf9 4869. [bug] Address some cases where NULL with zero length could
be passed to memmove which is undefined behaviour and
                        can lead to bad optimisation. [RT #46888]
2018-01-22 09:36:12 +11:00
Michał Kępień
73819362d8 [master] Simplify handling isc_socket_sendto2() return values when flags == 0
4865.	[cleanup]	Simplify handling isc_socket_sendto2() return values.
			[RT #46986]
2018-01-16 08:33:30 +01:00
Mukund Sivaraman
f96133826e Fix various bugs reported by valgrind --tool=memcheck (#46978) 2018-01-13 00:33:35 +05:30
Tinderbox User
10e49fc83b update copyright notice / whitespace 2018-01-04 23:45:32 +00:00
Evan Hunt
053b51c4db [master] block validator deadlock and prevent use-after-free
4859.	[bug]		A loop was possible when attempting to validate
			unsigned CNAME responses from secure zones;
			this caused a delay in returning SERVFAIL and
			also increased the chances of encountering
			CVE-2017-3145. [RT #46839]

4858.	[security]	Addresses could be referenced after being freed
			in resolver.c, causing an assertion failure.
			(CVE-2017-3145) [RT #46839]
2018-01-03 19:11:18 -08:00
Michał Kępień
6035d557c4 [master] Refactor reclimit system test
4823.	[test]		Refactor reclimit system test to improve its
			reliability and speed. [RT #46632]
2017-11-21 10:32:45 +01:00
Evan Hunt
c9f8165a06 [master] tag initializing keys
4798.	[func]		Keys specified in "managed-keys" statements
			are tagged as "initializing" until they have been
			updated by a key refresh query. If initialization
			fails it will be visible from "rndc secroots".
			[RT #46267]
2017-10-27 15:49:44 -07:00
Evan Hunt
06049b1c6c [master] stats counter for priming queries
4795.	[func]		A new statistics counter has been added to track
			priming queries. [RT #46313]
2017-10-26 21:38:43 -07:00