Commit graph

11032 commits

Author SHA1 Message Date
Petr Menšík
6992c50240 Fix regression in dnstap_test with native pkcs11
Change to cmocka broken initialization of TZ environment. This time,
commit 1cf1254051 is not soon enough. Has
to be moved more forward, before any other tests. It library is not full
reinitialized on each test.

(cherry picked from commit 71c4fad592)
2019-03-15 16:19:44 +11:00
Petr Mensik
5480d26da4 Workaround to kyua bug
Kyua 0.13 is not able to correctly handle whole test skipping.
Make workaround to it, include skipping message.
2019-03-14 14:19:45 -07:00
Mark Andrews
8a85e3d924 force promotion to unsigned int
(cherry picked from commit 1eba2c5b06)
2019-03-14 13:53:04 -07:00
Mark Andrews
25268aaf8c assert hevent->rdataset is non NULL
(cherry picked from commit d8d04edfba)
2019-03-14 13:17:10 -07:00
Mark Andrews
e6ab8fc7d0 add missing MAYBE_UNLOCK
(cherry picked from commit ff8bf617e7)
2019-03-14 09:01:31 +11:00
Witold Kręcicki
ff401e670f Fix a race in fctx_cancelquery.
When sending an udp query (resquery_send) we first issue an asynchronous
isc_socket_connect and increment query->connects, then isc_socket_sendto2
and increment query->sends.
If we happen to cancel this query (fctx_cancelquery) we need to cancel
all operations we might have issued on this socket. If we are under very high
load the callback from isc_socket_connect (resquery_udpconnected) might have
not yet been fired. In this case we only cancel the CONNECT event on socket,
and ignore the SEND that's waiting there (as there is an `else if`).
Then we call dns_dispatch_removeresponse which kills the dispatcher socket
and calls isc_socket_close - but if system is under very high load, the send
we issued earlier might still not be complete - which triggers an assertion
because we're trying to close a socket that's still in use.

The fix is to always check if we have incomplete sends on the socket and cancel
them if we do.

(cherry picked from commit 56183a3917)
2019-03-12 13:00:05 -07:00
Michał Kępień
78ecd57872 Make delv use OS-supplied ephemeral port range
Make delv honor the operating system's preferred ephemeral port range
instead of always using the default 1024-65535 range for outgoing
messages.

(cherry picked from commit ada6846a10)
2019-03-08 13:14:10 +01:00
Tony Finch
660c9af77b cleanup: use dns_secalg_t and dns_dsdigest_t where appropriate
Use them in structs for various rdata types where they are missing.
This doesn't change the structs since we are replacing explicit
uint8_t field types with aliases for uint8_t.

Use dns_dsdigest_t in library function arguments.

(cherry picked from commit 0f219714e1)
2019-03-08 22:25:27 +11:00
Mark Andrews
b3479ae5b0 #include <limits.h> for PATH_MAX, define if not found
(cherry picked from commit 1fc7be36eb)
2019-03-08 18:24:13 +11:00
Evan Hunt
148aa70127 silence a warning about potential snprintf overrun
(cherry picked from commit 7f26cad247)
2019-03-07 21:49:15 -08:00
Mark Andrews
28ea43ab35 Handle EDQUOT and ENOSPC errors
(cherry picked from commit 435ae2f29a)
2019-03-07 21:29:59 -08:00
Mark Andrews
09ce08a85f fix the use of dns_wildcardname as an optimisation in DLZ
(cherry picked from commit cb32cd98bd)
2019-03-07 20:34:59 -08:00
Mark Andrews
2671666ef8 improve clang / cmocka integration
(cherry picked from commit cb913177ae)
2019-03-05 11:04:46 -08:00
Tinderbox User
4738d62e1c doc rebuild 2019-02-20 19:54:40 -08:00
Tinderbox User
4b1b4e1f78 prep 9.11.6rc1 2019-02-20 19:54:38 -08:00
Matthijs Mekking
8f64928e2e Update keyfetch_done compute_tag check
If in keyfetch_done the compute_tag fails (because for example the
algorithm is not supported), don't crash, but instead ignore the
key.

(cherry picked from commit b1d5411569ae10830b63f07560091193646cc739)
2019-02-20 19:54:20 -08:00
Matthijs Mekking
acae423ef4 Don't free key in compute_tag in case of failure
If `dns_dnssec_keyfromrdata` failed we don't need to call
`dst_key_free` because no `dstkey` was created.  Doing so
nevertheless will result in an assertion failure.

This can happen if the key uses an unsupported algorithm.

(cherry picked from commit 7a1ca39b950b7d5230b605ac60f15a1cb94e3d69)
2019-02-20 19:54:20 -08:00
Evan Hunt
4c15bbfb50 timer_test failed to compile if cmocka was enabled but threads were not
(cherry picked from commit c73e3175c7)
2019-02-20 19:00:26 -08:00
Mark Andrews
28e054c36c teach proto_c to look in the source directory for out of tree builds
(cherry picked from commit c0d4ff5796)
2019-02-20 09:46:07 +11:00
Mark Andrews
78bb82abd3 remove redundant assignment
(cherry picked from commit f475dc75b1)
2019-02-19 10:26:00 +11:00
Mark Andrews
434fcb5f1e remove seen_dname
(cherry picked from commit 63c03cdb2d)
2019-02-19 10:24:45 +11:00
Mark Andrews
333ce68d35 fix memory leak
(cherry picked from commit 7114d16098)
2019-02-19 09:38:09 +11:00
Mark Andrews
d50b1ecd9c assert result is ISC_R_SUCCESS
(cherry picked from commit 76a1c1531a)
2019-02-19 08:00:30 +11:00
Mark Andrews
495d4153ad fix AMTRELAY name
(cherry picked from commit a9fadafecd)
2019-02-08 14:10:37 +11:00
Mark Andrews
4b955e8257 add top of range checks
(cherry picked from commit 8d69e15988)
2019-02-08 10:28:28 +11:00
Evan Hunt
37ad2d4de3 Add support for ZONEMD
(cherry picked from commit 3183663dd4)
2019-02-08 08:33:09 +11:00
Mark Andrews
060dd0a372 Add support for ATMRELAY
(cherry picked from commit 66922ee7af)
2019-02-08 08:33:08 +11:00
Evan Hunt
a6afd50cb9 Change #4148 wasn't complete
- there was a memory leak when using negotiated TSIG keys.
- TKEY responses could only be signed when using a newly negotiated
  key; if an existent matching TSIG was found in in the keyring it
  would not be used.

(cherry picked from commit 73ba24fb36)
2019-01-31 09:29:22 -08:00
Matthijs Mekking
326d40ab08 allow TSIG key to be added to message structure after parsing
up until now, message->tsigkey could only be set during parsing
of the request, but gss-tsig allows one to be created afterward.

(cherry picked from commit 879fc0285e)
2019-01-30 12:34:02 -08:00
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