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

7350 Commits

Author SHA1 Message Date
Mark Andrews
b089f43b7a Check multi-line output from dns_rdata_tofmttext()
Check that multi-line output from dns_rdata_tofmttext() can be read
back in by dns_rdata_fromtext().
2019-04-11 19:19:46 +10:00
Mark Andrews
1a75a5cee6 Process master file comments and make input invalid again 2019-04-11 19:19:10 +10:00
Mark Andrews
7941a9554f Set 'specials' to match 'specials' in 'lib/dns/master.c' 2019-04-11 18:13:39 +10:00
Mark Andrews
cc5e16e4d3 Fix whitespace so that the names align 2019-04-11 18:13:39 +10:00
Mark Andrews
36f30f5731 Add dns_rdata_totext() and dns_rdata_fromtext() to fromwire
Add dns_rdata_totext() and dns_rdata_fromtext() to fromwire for
valid inputs to ensure that what we accept in dns_rdata_fromwire()
can be written out and read back in.
2019-04-11 18:13:39 +10:00
Mark Andrews
8fd4308bda Initialise mincachettl and minncachettl to zero in dns_view_create. 2019-04-10 14:48:49 +10:00
Mark Andrews
6eb28eda1e add ds unit test 2019-04-10 13:37:03 +10:00
Mark Andrews
b274f3fad7 enforce DS hash exists 2019-04-10 13:36:08 +10:00
Mark Andrews
7b0a653858 check that from fromtext produces valid towire input 2019-04-10 11:13:52 +10:00
Mark Andrews
82d4931440 for rkey flags MUST be zero 2019-04-09 13:55:30 +10:00
Mark Andrews
2592e91516 check flags for no key in fromwire for *KEY 2019-04-09 13:55:30 +10:00
Mark Andrews
698a6f955e <dns/ecs.h> was missing ISC_LANG_ENDDECLS. 2019-04-09 11:47:26 +10:00
Witold Kręcicki
06021b3529 Fix deadlock in RPZ update code.
In dns_rpz_update_from_db we call setup_update which creates the db
iterator and calls dns_dbiterator_first. This unpauses the iterator and
might cause db->tree_lock to be acquired. We then do isc_task_send(...)
on an event to do quantum_update, which (correctly) after each iteration
calls dns_dbiterator_pause, and re-isc_task_sends itself.

That's an obvious bug, as we're holding a lock over an async task send -
if a task requesting write (e.g. prune_tree) is scheduled on the same
workers queue as update_quantum but before it, it will wait for the
write lock indefinitely, resulting in a deadlock.

To fix it we have to pause dbiterator in setup_update.
2019-04-06 12:22:49 -07:00
Witold Kręcicki
7c960e89ea In resume_qmin check if the fetch context is already shutting down - if so, try to destroy it, don't continue 2019-03-29 14:30:40 +01:00
Witold Kręcicki
51a55ddbb7 Fix assertion failure in nslookup/dig/mdig when message has multiple SIG(0) options.
When parsing message with DNS_MESSAGE_BESTEFFORT (used exclusively in
tools, never in named itself) if we hit an invalid SIG(0) in wrong
place we continue parsing the message, and put the sig0 in msg->sig0.
If we then hit another sig0 in a proper place we see that msg->sig0
is already 'taken' and we don't free name and rdataset, and we don't
set seen_problem. This causes an assertion failure.
This fixes that issue by setting seen_problem if we hit second sig0,
tsig or opt, which causes name and rdataset to be always freed.
2019-03-26 21:15:00 +11:00
Ondřej Surý
8ccce7e24b Make lib/dns/dnstap.pb-c.h private header
This changes dns_dtdata struct to not expose data types from dnstap.pb-c.h to
prevent the need for including this header where not really needed.
2019-03-22 11:38:45 +01:00
Mark Andrews
473987d8d9 Disallow empty ZONEMD hashes
This change is the result of discussions with the authors of
draft-wessels-dns-zone-digest.
2019-03-22 06:49:01 +11:00
Mark Andrews
40a770b932 add brackets for multi-line output 2019-03-21 19:52:27 +11:00
Evan Hunt
b3ff3bf2e4 remove configuration, syntax checking and implementation of dnssec-enable 2019-03-14 23:29:07 -07:00
Petr Menšík
71c4fad592 Fix regression in dnstap_test with native pkcs11
Change to cmocka broken initialization of TZ environment. This time,
commit 1cf12540515e4a3fc93ace02b81815209f1e709e is not soon enough. Has
to be moved more forward, before any other tests. It library is not full
reinitialized on each test.
2019-03-15 01:03:53 -04:00
Mark Andrews
1eba2c5b06 force promotion to unsigned int 2019-03-14 13:34:59 -07:00
Mark Andrews
d8d04edfba assert hevent->rdataset is non NULL 2019-03-14 12:47:53 -07:00
Mark Andrews
719b1d7fdc missing #include <isc/lang.h> 2019-03-15 00:24:33 +11:00
Mark Andrews
ff8bf617e7 add missing MAYBE_UNLOCK 2019-03-13 10:51:56 +11:00
Witold Kręcicki
56183a3917 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.
2019-03-12 18:42:35 +01:00
Mark Andrews
a520662ed4 allow dlz to signal that the view's transfer acl should be used 2019-03-11 14:27:13 +11:00
Ondřej Surý
a04a390195 Convert *.vcxproj.user to CRLF line endings 2019-03-08 18:01:48 +01:00
Ondřej Surý
c2637c8429 Use ForcedIncludeFiles directive to include config.h everywhere automatically 2019-03-08 17:14:38 +01:00
Ondřej Surý
1b25d8a0ca Remove explicit '#include <config.h>' from the header files (the include should not have been there in the first place) 2019-03-08 15:15:05 +01:00
Ondřej Surý
78d0cb0a7d Use coccinelle to remove explicit '#include <config.h>' from the source files 2019-03-08 15:15:05 +01:00
Michał Kępień
ada6846a10 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.
2019-03-08 13:13:32 +01:00
Tony Finch
0f219714e1 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.

Improve dnssec-cds with these more specific types.
2019-03-08 18:37:50 +11:00
Mark Andrews
1fc7be36eb #include <limits.h> for PATH_MAX, define if not found 2019-03-08 17:15:01 +11:00
Evan Hunt
7f26cad247 silence a warning about potential snprintf overrun 2019-03-08 00:27:49 -05:00
Mark Andrews
cb32cd98bd fix the use of dns_wildcardname as an optimisation in DLZ 2019-03-07 19:59:29 -08:00
Mark Andrews
d1fa8be611 add the ability to control whether SOA records are added response-policy modified answers 2019-03-06 20:47:28 -08:00
Mark Andrews
cb913177ae improve clang / cmocka integration 2019-03-05 10:20:29 -08:00
Matthijs Mekking
e5565808e4 Update CHANGES 2019-02-22 14:00:01 +01:00
Matthijs Mekking
6ed14eff25 Unregister RPZ CATZ db cbs when zone load fails
In case when a zone fails to load because the file does not exist
or is malformed, we should not run the callback that updates the
zone database when the load is done.  This is achieved by
unregistering the callbacks if at zone load end if the result
indicates something else than success.
2019-02-22 13:59:10 +01:00
Matthijs Mekking
6756280242 Remove rpz->db_registered
As pointed out in !813 db_registered is sort of redundant.  It is
set to `true` only in `dns_zone_rpz_enable_db()` right before the
`dns_rpz_dbupdate_callback()` callback is registered.  It is only
required in that callback and it is the only place that the callback
is registered.  Therefore there is no path that that `REQUIRE` can
fail.

The `db_registered` variable is only set to `false` in
`dns_rpz_new_zone`, so it is not like the variable is unset again
later.

The only other place where `db_registered` is checked is in
`rpz_detach()`.  If `true`, it will call
`dns_db_updatenotify_unregister()`.  However if that happens, the
`db_registered` is not set back to `false` thus this implies that
this may happen multiple times.  If called a second time, most
likely the unregister function will return `ISC_R_NOTFOUND`, but
the return value is not checked anyway.  So it can do without the
`db_registered` check.
2019-02-22 13:59:10 +01:00
Matthijs Mekking
2e5e429644 Add curly brackets on if statements 2019-02-22 13:59:10 +01:00
Matthijs Mekking
a490c09121 named crashes on shutdown after load rpz failed
This may happen when loading an RPZ failed and the code path skips
calling dns_db_endload().  The dns_rpz_zone_t object is still kept
marked as having registered db.  So when this object is finally
destroyed in rpz_detach(), this code will incorrectly call
`dns_db_updatenotify_unregister()`:

   if (rpz->db_registered)
     dns_db_updatenotify_unregister(rpz->db,
                                    dns_rpz_dbupdate_callback, rpz);

and trigger this assertion failure:

   REQUIRE(db != NULL);

To fix this, only call `dns_db_updatenotify_unregister()` when
`rpz->db` is not NULL.
2019-02-22 13:59:10 +01:00
Evan Hunt
efb0d1e83d documentation changes setting up 9.15 development branch 2019-02-21 16:42:17 -08:00
Matthijs Mekking
f09352d20a 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.
2019-02-20 19:44:33 -08:00
Matthijs Mekking
235a64a5a4 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.
2019-02-20 19:44:32 -08:00
Mark Andrews
c0d4ff5796 teach proto_c to look in the source directory for out of tree builds 2019-02-20 09:27:00 +11:00
Mark Andrews
f475dc75b1 remove redundant assignment 2019-02-18 17:40:56 -05:00
Mark Andrews
9a9dc4072f declarations before assertions 2019-02-18 17:40:56 -05:00
Mark Andrews
63c03cdb2d remove seen_dname 2019-02-18 17:40:56 -05:00
Mark Andrews
4938f97c97 record when querytsig is valid 2019-02-18 17:39:08 -05:00