Commit graph

11003 commits

Author SHA1 Message Date
Petr Menšík
af021f136e Do not fail on NULL passed to OpenSSL_free
Some plugins might call it after deconstruction. Do not crash if there
is no reason for it.

(cherry picked from commit a26673a088)
2019-01-29 15:42:51 -08:00
Evan Hunt
665122be0d Revert "Merge branch 'ondrej/fix-race-condition-in-dnstap-v9_11' into 'v9_11'"
This reverts merge request !1345
2019-01-23 13:56:26 -05:00
Evan Hunt
e511187ebd removed a debugging fprintf
(cherry picked from commit 6c478a3dae)
2019-01-21 17:01:11 +11:00
Witold Kręcicki
aa9866c390 If possible don't use forwarders when priming the resolver.
If we try to fetch a record from cache and need to look into
hints database we assume that the resolver is not primed and
start dns_resolver_prime(). Priming query is supposed to return
NSes for "." in ANSWER section and glue records for them in
ADDITIONAL section, so that we can fill that info in 'regular'
cache and not use hints db anymore.
However, if we're using a forwarder the priming query goes through
it, and if it's configured to return minimal answers we won't get
the addresses of root servers in ADDITIONAL section. Since the
only records for root servers we have are in hints database we'll
try to prime the resolver with every single query.

This patch adds a DNS_FETCHOPT_NOFORWARD flag which avoids using
forwarders if possible (that is if we have forward-first policy).
Using this flag on priming fetch fixes the problem as we get the
proper glue. With forward-only policy the problem is non-existent,
as we'll never ask for root server addresses because we'll never
have a need to query them.

Also added a test to confirm priming queries are not forwarded.

(cherry picked from commit b49310ac06)
(cherry picked from commit f8963ad70e)
2019-01-16 22:27:52 -08:00
Petr Menšík
3442c69911 Make sure null atributes are never used
Add INSIST to pubattr fetching where null might occur in therory. Make
sure null is never dereferenced.

(cherry picked from commit fe9ef0d9f5)
2019-01-17 09:00:42 +11:00
Mark Andrews
bf6133ea61 adjust timeout to allow for ECN negotiation failures
(cherry picked from commit dadb924be7)
2019-01-15 17:30:20 -08:00
Ondřej Surý
5c73b97715 Fix race condition in cleanup part of dns_dt_create()
(cherry picked from commit 482dd7eed3)
2019-01-15 09:51:25 +01:00
Mark Andrews
34cf4336ac ensure that WSAStartup is called before getservbyname
(cherry picked from commit ac01359871)
2019-01-15 16:29:25 +11:00
Mark Andrews
8bb42d7812 update refreshkeytime
(cherry picked from commit ca977e3976)
2019-01-09 19:48:58 +11:00
Mark Andrews
3266d3c4da maybe_numeric failed to handle NUL in text region.
(cherry picked from commit ee23780246)
2019-01-09 19:08:22 +11:00
Mark Andrews
58cc1ee718 Ensure base64/base32/hex fields in DNS records that should be non-empty are.
(cherry picked from commit 5e8b772ad1)
2019-01-09 18:52:50 +11:00
Mark Andrews
6750780e88 allow for up 100 records or 64K of data to be in a ncache entry
(cherry picked from commit 604889e627)
2019-01-09 16:17:07 +11:00
Mark Andrews
e4f7d6c418 explictly convert ISC_R_NOSPACE from dns_message_parse to DNS_R_FORMERR and remove from dns_result_torcode
(cherry picked from commit 0c42a9c0ab)
2019-01-08 20:51:27 -08:00
Michał Kępień
3db9f56718 Track forwarder timeouts in fetch contexts
Since following a delegation resets most fetch context state, address
marks (FCTX_ADDRINFO_MARK) set inside lib/dns/resolver.c are not
preserved when a delegation is followed.  This is fine for full
recursive resolution but when named is configured with "forward first;"
and one of the specified forwarders times out, triggering a fallback to
full recursive resolution, that forwarder should no longer be consulted
at each delegation point subsequently reached within a given fetch
context.

Add a new badnstype_t enum value, badns_forwarder, and use it to mark a
forwarder as bad when it times out in a "forward first;" configuration.
Since the bad server list is not cleaned when a fetch context follows a
delegation, this prevents a forwarder from being queried again after
falling back to full recursive resolution.  Yet, as each fetch context
maintains its own list of bad servers, this change does not cause a
forwarder timeout to prevent that forwarder from being used by other
fetch contexts.

(cherry picked from commit 33350626f9)
2019-01-08 08:34:37 +01:00
Mark Andrews
84527eb4d5 update copyrights 2019-01-02 10:26:49 +11:00
Ondřej Surý
4892b52156 Fix the stdatomic #ifdefs to work with older compilers 2018-12-21 09:29:47 +01:00
Ondřej Surý
074cc75aa7 Add better EMPTY_TRANSLATION_UNIT to isc/util.h 2018-12-21 09:29:47 +01:00
Ondřej Surý
c116fb963a Fix ECC algorithms unused constants in PKCS#11 build 2018-12-21 09:29:47 +01:00
Ondřej Surý
51286ec006 Add unreachable.spatch coccinelle recipe and run it in precheck CI phase 2018-12-21 09:29:47 +01:00
Ondřej Surý
0c6c59a289 Use isc__strerror instead of strerror_r in v9_11 branch 2018-12-21 09:26:50 +01:00
Ondřej Surý
7d9e19b5eb Abort on allocation failure only if the memory functions are used internally in BIND 9
(cherry picked from commit c22241ae9009391c1d28085c5cf0009a6caef09c)
2018-12-21 03:03:24 -05:00
Ondřej Surý
c73912278b Abort on memory allocation failure
(cherry picked from commit 8de2451756)
2018-12-21 03:03:24 -05:00
Matthijs Mekking
1360a1fa1a Move REQUIRE outside comment unsupported alg
(cherry picked from commit 5ca649967e)
2018-12-20 04:50:08 -05:00
Matthijs Mekking
040e132f16 Allow unsupported alg in zone /w dnssec-signzone
dnssec-signzone should sign a zonefile that contains a DNSKEY record
with an unsupported algorithm.  Current behavior is that it will
fail, hitting a fatal error.  The fix detects unsupported algorithms
and will not try to add it to the keylist.

Also when determining the maximum iterations for NSEC3, don't take
into account DNSKEY records in the zonefile with an unsupported
algorithm.

(cherry picked from commit 1dd11fc754)
2018-12-20 04:50:08 -05:00
Ondřej Surý
d0dadf5ac4 __SANITIZE_ADDRESS__ needs to be defined to 1
(cherry picked from commit ff7c868f25)
2018-12-20 00:15:59 +01:00
Ondřej Surý
11cce88a41 gcc defines __SANITIZE_ADDRESS__ and not __ADDRESS_SANITIZER__, use the correct #define
(cherry picked from commit 8903d68d69)
2018-12-19 12:46:05 +01:00
Ondřej Surý
8fbd61343a Disable RTLD_DEEPBIND when compiled under AddressSanitizer
(cherry picked from commit cad6b39cab)
2018-12-19 10:51:09 +01:00
Ondřej Surý
9827b8ade9 Define __ADDRESS_SANITIZER__ if compiling under clang's AddressSanitizer
(cherry picked from commit e1ce3a3d42)
2018-12-19 10:50:54 +01:00
Mark Andrews
7aecb8b1fd pass the correct object to cfg_obj_log
(cherry picked from commit 53a33f7365)
2018-12-15 09:38:42 +11:00
Mark Andrews
da49d1cfc3 add unit tests for dns_rdatatype_atcname, dns_rdatatype_atparent and iszonecutauth
(cherry picked from commit f2f7711977)
2018-12-14 14:44:20 +11:00
Mark Andrews
587c81ac99 create dns_rdatatype_atcname to split records that can appear along side CNAME from DNSSEC; dns_rdatatype_iszonecutauth allowed too many types
(cherry picked from commit f4ceb12b69)
2018-12-14 14:29:46 +11:00
Mark Andrews
ed232e96d1 log a error if we don't explicitly know that a error has been logged in zone_sign
(cherry picked from commit b108376a10)
2018-12-10 15:13:53 +11:00
Mark Andrews
f8dc30d18b Properly detect bottom of zone when sign_a_node() is not called
(cherry picked from commit 9eec02a81f)
2018-12-07 12:20:09 +11:00
Mark Andrews
3c4a118978 only test for prefixlen <= 63
(cherry picked from commit 5744415a75)
2018-12-03 17:04:59 +11:00
Mark Andrews
c0a3c48802 add missing DBC checks for catz and add isc_magic checks; add DBC checks to ht.c
(cherry picked from commit a487473fc5)
(cherry picked from commit 17d9fa3cc7)
2018-11-29 15:05:17 +11:00
Mark Andrews
12f2ea418c update zname with the current zone anme
(cherry picked from commit 0708e43d3f)
2018-11-28 23:34:42 +11:00
Mark Andrews
156195dac6 address coverity side effect in assert warning
(cherry picked from commit 2156a5b610)
2018-11-23 10:21:53 +11:00
Witold Kręcicki
50d7e0b4ef Use proper casting in socket unit test
(cherry picked from commit 5f81aa10bc)
2018-11-22 10:34:43 +11:00
Ondřej Surý
2386be289c Use strlcpy in place where strncpy(s, ...) + s[sizeof(s)-1] = \0; was used
(cherry picked from commit 175f06949f)
2018-11-22 08:11:31 +11:00
Ondřej Surý
78a94766d7 Fix memory leak in lex_test.c
(cherry picked from commit 7a3eb391fa)
2018-11-21 15:46:55 -05:00
Evan Hunt
58314571ef remove (or hide behind a 'verbose' flag) extra output from system tests
(cherry picked from commit 8f15219f36)
2018-11-16 13:00:49 -08:00
Evan Hunt
2ed9b06ab8 remove ATF source code and Atffiles
(cherry picked from commit 8c4d50c6bc)
(cherry picked from commit 33f428efda)
2018-11-15 17:52:00 -08:00
Joey
49cfe448da convert update_test; remove ATF from lib/dns/tests
(cherry picked from commit 336d5a5374)
(cherry picked from commit 4beba42654)
2018-11-15 17:51:56 -08:00
Evan Hunt
3a8eff4589 convert gost_test
(cherry picked from commit 28296fc57c)
2018-11-15 17:51:47 -08:00
Joey
f919fb6e0e convert tsig_test
(cherry picked from commit 92a3762cb6)
(cherry picked from commit ea300146a8)
2018-11-15 17:51:42 -08:00
Joey
ab76e6a8b7 convert time_test
(cherry picked from commit 2c7e6947fa)
(cherry picked from commit 132bdcb954)
2018-11-15 17:51:35 -08:00
Joey
e938089e20 convert sigs_test
(cherry picked from commit eda6281f98)
(cherry picked from commit 34855ec13b)
2018-11-15 17:51:30 -08:00
Joey
2ba04b17a8 convert rsa_test
(cherry picked from commit b915cdbf0b)
(cherry picked from commit c00f2c9434)
2018-11-15 17:51:24 -08:00
Joey
e0b408a5ee convert resolver_test
(cherry picked from commit 2837a821e8)
(cherry picked from commit bd3bb7cb89)
2018-11-15 17:51:12 -08:00
Joey
0f2b87f0ae convert rbt_serialize_test
(cherry picked from commit dfd90dbb82)
(cherry picked from commit 5e44278871)
2018-11-15 17:51:06 -08:00