Commit Graph
12464 Commits
Author SHA1 Message Date
Ondřej Surý e847591867 Improve the backtrace to print symbols when backtrace_symbols() is available
The previous commit removed the code related to the internal symbol
table.  On platforms where available, we can now use backtrace_symbols()
to print more verbose symbols table to the output.

As there's now general availability of backtrace() and
backtrace_symbols() functions (see below), the commit also removes the
usage of glibc internals and the custom stack tracing.

* backtrace(), backtrace_symbols(), and backtrace_symbols_fd() are
  provided in glibc since version 2.1.
* backtrace(), backtrace_symbols(), and backtrace_symbols_fd() first
  appeared in Mac OS X 10.5.
* The backtrace() library of functions first appeared in NetBSD 7.0 and
  FreeBSD 10.0.
2020-03-11 20:32:21 +01:00
Evan HuntandOndřej Surý ad5250ff9c Remove support for internal symbol table
Since we can no longer generate an internal symbol table, there
doesn't seem to be much reason to retain the code that reads it.
2020-03-11 11:13:52 +01:00
Ondřej Surý 1628f5865a Remove configure option to compile without libtool
libtool is a requirement to use automake (see GL #4), so this commit
removes the ability to compile BIND 9 without libtool.
2020-03-11 10:31:51 +01:00
Ondřej Surý 584fd98a0c Fixup the headers formatting 2020-03-11 10:19:32 +01:00
Ondřej Surý 1ca73f606e Fix the deeper symlinks to .clang-format.headers 2020-03-11 10:16:45 +01:00
Diego FronzaandMatthijs Mekking a200852001 Fixed data race in log.c
A data race was happening while BIND was starting due to
isc_log_wouldlog function accessing lctx->logconfig without a lock.

To prevent that without incurring much costs, that variable was made
atomic.
2020-03-10 11:49:53 +01:00
Evan Hunt b54454b7c6 remove redundant ZONEDB_UNLOCK 2020-03-09 14:05:14 -07:00
Ondřej Surý 3178974f0c Use the new sorting rules to regroup #include headers 2020-03-09 16:19:22 +01:00
Matthijs Mekking e0bdff7ecd Fix race condition dnssec-policy with views
When configuring the same dnssec-policy for two zones with the same
name but in different views, there is a race condition for who will
run the keymgr first. If running sequential only one set of keys will
be created, if running parallel two set of keys will be created.

Lock the kasp when running looking for keys and running the key
manager. This way, for the same zone in different views only one
keyset will be created.

The dnssec-policy does not implement sharing keys between different
zones.
2020-03-09 14:48:17 +01:00
Diego Fronza 6e5b4f7ec8 Fixed missing list initialization
This commit fixes isc_glob function on windows environments.

The file_list_t * object pointed to by pglob->reserved was missing
ISC_LIST_INIT intialization macro.
2020-03-06 16:53:20 -03:00
Matthijs Mekking 53bd81ad19 Make clang-format happy 2020-03-06 15:57:48 +01:00
Matthijs Mekking 3905a03205 [#1624] dnssec-policy change retire unwanted keys
When changing a dnssec-policy, existing keys with properties that no
longer match were not being retired.
2020-03-06 15:53:57 +01:00
Matthijs Mekking 28506159f0 [#1625] Algorithm rollover waited too long
Algorithm rollover waited too long before introducing zone
signatures.  It waited to make sure all signatures were resigned,
but when introducing a new algorithm, all signatures are resigned
immediately.  Only add the sign delay if there is a predecessor key.
2020-03-06 15:53:57 +01:00
Matthijs Mekking a8542b8cab [#1626] Fix stuck algorithm rollover
Algorithm rollover was stuck on submitting DS because keymgr thought
it would move to an invalid state.  It did not match the current
key because it checked it against the current key in the next state.
Fixed by when checking the current key, check it against the desired
state, not the existing state.
2020-03-06 15:53:57 +01:00
Matthijs Mekking 88ebe9581b Add algorithm rollover test case
Add a test case for algorithm rollover.  This is triggered by
changing the dnssec-policy.  A new nameserver ns6 is introduced
for tests related to dnssec-policy changes.

This requires a slight change in check_next_key_event to only
check the last occurrence.  Also, change the debug log message in
lib/dns/zone.c to deal with checks when no next scheduled key event
exists (and default to loadkeys interval 3600).
2020-03-06 15:53:57 +01:00
Evan Hunt 89615c2ab5 add serial number to "transfer ended" log messages 2020-03-05 17:20:16 -08:00
Evan Hunt cb02219b6c check size ratio when responding to IXFR requests 2020-03-05 17:20:16 -08:00
Evan Hunt 98b55eb442 improve calculation of database transfer size
- change name of 'bytes' to 'xfrsize' in dns_db_getsize() parameter list
  and related variables; this is a more accurate representation of what
  the function is doing
- change the size calculations in dns_db_getsize() to more accurately
  represent the space needed for a *XFR message or journal file to contain
  the data in the database. previously we returned the sizes of all
  rdataslabs, including header overhead and offset tables, which
  resulted in the database size being reported as much larger than the
  equivalent *XFR or journal.
- map files caused a particular problem here: the fullname can't be
  determined from the node while a file is being deserialized, because
  the uppernode pointers aren't set yet. so we store "full name length"
  in the dns_rbtnode structure while serializing, and clear it after
  deserialization is complete.
2020-03-05 17:20:16 -08:00
Evan Hunt 52a31a9883 dns_journal_iter_init() can now return the size of the delta
the call initailizing a journal iterator can now optionally return
to the caller the size in bytes of an IXFR message (not including
DNS header overhead, signatures etc) containing the differences from
the beginning to the ending serial number.

this is calculated by scanning the journal transaction headers to
calculate the transfer size. since journal file records contain a length
field that is not included in IXFR messages, we subtract out the length
of those fields from the overall transaction length.

this necessitated adding an "RR count" field to the journal transaction
header, so we know how many length fields to subract. NOTE: this will
make existing journal files stop working!
2020-03-05 17:20:16 -08:00
Evan Hunt aeef4719e9 add syntax and setter/getter functions to configure max-ixfr-ratio 2020-03-05 17:20:16 -08:00
Michał KępieńandMark Andrews b675d30f09 Fix lists of installed header files 2020-03-05 23:09:51 +00:00
Witold Kręcicki 4b9962d4a3 Only use tcpdns timer if it's initialized. 2020-03-05 23:13:39 +01:00
Witold Kręcicki ae1499ca19 Fix TCPDNS socket closing issues 2020-03-05 18:02:27 +00:00
Witold Kręcicki fc9792eae8 Limit TCP connection quota logging to 1/s 2020-03-05 18:02:27 +00:00
Witold Kręcicki fc9e2276ca Proper accounting of active TCP connections 2020-03-05 18:02:27 +00:00
Witold Kręcicki df3dbdff81 Destroy query in killoldestquery under a lock.
Fixes a race between ns_client_killoldestquery and ns_client_endrequest -
killoldestquery takes a client from `recursing` list while endrequest
destroys client object, then killoldestquery works on a destroyed client
object. Prevent it by holding reclist lock while cancelling query.
2020-03-05 08:13:50 +00:00
Tony FinchandEvan Hunt 689ef89b67 Fix dns_client_addtrustedkey(dns_rdatatype_dnskey)
Use a buffer that is big enough for DNSKEY records as well as DS
records.
2020-03-04 08:59:29 -08:00
Evan Hunt 7a3fa9f593 list "validate-except" entries in "rndc nta -d" and "rndc secroots"
- no longer exclude these entries when dumping the NTA table
- indicate "validate-except" entries with the keyword "permanent" in
  place of an expiry date
- add a test for this feature, and update other tests to account for
  the presence of extra lines in some rndc outputs
- incidentally removed the unused function dns_ntatable_dump()
- CHANGES, release note
2020-03-04 00:44:32 -08:00
Mark Andrews f171347b5f Restart zone maintenance if it had been stalled. 2020-03-04 08:45:34 +11:00
Witold KręcickiandOndřej Surý 81ba0fe0e6 Fix a race in isc_socket destruction.
There was a very slim chance of a race between isc_socket_detach and
process_fd: isc_socket_detach decrements references to 0, and before it
calls destroy gets preempted. Second thread calls process_fd, increments
socket references temporarily to 1, and then gets preempted, first thread
then hits assertion in destroy() as the reference counter is now 1 and
not 0.
2020-03-03 08:34:19 +01:00
Ondřej SurýandMark Andrews aaaa7e67fa Adjust lock/unlock in zone_rekey() 2020-03-03 15:26:31 +11:00
Mark Andrews a6626594aa Ensure that resigintime and the zone timer are set 2020-03-03 15:26:27 +11:00
Matthijs MekkingandMark Andrews 143d1c9767 Add more zone locks
Add more zone locks around code that touches zone timer setting
in failure modes.
2020-03-03 15:26:27 +11:00
Mark Andrews 7212961849 Always call set_resigntime with the zone lock held 2020-03-03 15:26:27 +11:00
Mark Andrews 5ec57f31b0 Always call zone_settimer()
zone_needdump() could potentially not call zone_settimer() so
explitly call zone_settimer() as zone->resigntime could have
gone backward.
2020-03-03 15:26:27 +11:00
Mark Andrews 5d1611afdc Call set_resigntime() in receive_secure_serial()
With RRSIG records no longer being signed with the full
sig-validity-interval we need to ensure the zone->resigntime
as it may need to be set to a earlier time.
2020-03-03 15:26:27 +11:00
Witold Kręcicki 6c8f309745 Workaround for clang static analyzer bug. 2020-03-02 14:12:05 +01:00
Witold Kręcicki 47e5f5564c Badcache with multiple locks.
Previously badcache used one single mutex for everything, which
was causing performance issues. Use one global rwlock for the whole
hashtable and per-bucket mutexes.
2020-03-02 12:13:09 +01:00
Michał Kępień fc967ba092 Add ZLIB_LIBS to ISCLIBS
When --with-zlib is passed to ./configure (or when the latter
autodetects zlib's presence), libisc uses certain zlib functions and
thus libisc's users should be linked against zlib in that case.  Adjust
Makefile variables appropriately to prevent shared build failures caused
by underlinking.
2020-02-28 15:22:29 +01:00
Evan HuntandWitold Kręcicki 0b76d8a490 comments 2020-02-28 08:46:16 +01:00
Witold Kręcicki 4b6a064972 Don't define NS_CLIENT_TRACE by default 2020-02-28 08:46:16 +01:00
Witold Kręcicki 4791263def Increase inactivehandles and inactivereqs size for better reuse. 2020-02-28 08:46:16 +01:00
Witold Kręcicki 0344684385 Increase nodelock count for both cache and regular db. 2020-02-28 08:46:16 +01:00
Witold Kręcicki 517e6eccdf use SO_INCOMING_CPU for UDP sockets 2020-02-28 08:46:16 +01:00
Witold Kręcicki 8c6c07286f Remove some stale fields from ns_client_t; make sendbuf allocated on heap 2020-02-28 08:46:16 +01:00
Witold Kręcicki fe584c01cc Don't update LRU if the node was recently used.
Updating LRU requires write-locking the node, which causes contention.
Update LRU only if time difference is large enough.
2020-02-28 08:46:16 +01:00
Witold Kręcicki a658f7976c We don't need to fill udp local address every time since we are bound to it. 2020-02-28 08:46:16 +01:00
Witold Kręcicki 938b61405b Don't check if the client is on recursing list (requires locking) if it's not RECURSING 2020-02-28 08:46:16 +01:00
Witold Kręcicki eb874608c1 Use the original threadid when sending a UDP packet to decrease probability of context switching 2020-02-28 08:46:16 +01:00
Mark Andrews a24fd55836 sort RRSIG(SOA) to be last of RRSIGs with a common re-resign time 2020-02-27 22:30:14 +00:00