1. 11 Jun, 2020 1 commit
    • Mark Andrews's avatar
      The dsset returned by dns_keynode_dsset needs to be thread safe. · e5b2eca1
      Mark Andrews authored
      - clone keynode->dsset rather than return a pointer so that thread
        use is independent of each other.
      - hold a reference to the dsset (keynode) so it can't be deleted
        while in use.
      - create a new keynode when removing DS records so that dangling
        pointers to the deleted records will not occur.
      - use a rwlock when accessing the rdatalist to prevent instabilities
        when DS records are added.
      e5b2eca1
  2. 29 May, 2020 1 commit
  3. 25 May, 2020 1 commit
  4. 01 May, 2020 1 commit
    • Michał Kępień's avatar
      Make dnstap work reliably with netmgr · 77dc0918
      Michał Kępień authored
      The introduction of netmgr doubled the number of threads from which
      dnstap data may be logged: previously, it could only happen from within
      taskmgr worker threads; with netmgr, it can happen both from taskmgr
      worker threads and from network threads.  Since the argument passed to
      fstrm_iothr_options_set_num_input_queues() was not updated to reflect
      this change, some calls to fstrm_iothr_get_input_queue() can now return
      NULL, effectively preventing some dnstap data from being logged.
      Whether this bug is triggered or not depends on thread scheduling order
      and packet distribution between network threads, but will almost
      certainly be triggered on any recursive resolver sooner or later.  Fix
      by requesting the correct number of dnstap input queues to be allocated.
      77dc0918
  5. 28 Apr, 2020 1 commit
  6. 21 Apr, 2020 1 commit
    • Ondřej Surý's avatar
      Complete rewrite the BIND 9 build system · 978c7b2e
      Ondřej Surý authored
      The rewrite of BIND 9 build system is a large work and cannot be reasonable
      split into separate merge requests.  Addition of the automake has a positive
      effect on the readability and maintainability of the build system as it is more
      declarative, it allows conditional and we are able to drop all of the custom
      make code that BIND 9 developed over the years to overcome the deficiencies of
      autoconf + custom Makefile.in files.
      
      This squashed commit contains following changes:
      
      - conversion (or rather fresh rewrite) of all Makefile.in files to Makefile.am
        by using automake
      
      - the libtool is now properly integrated with automake (the way we used it
        was rather hackish as the only official way how to use libtool is via
        automake
      
      - the dynamic module loading was rewritten from a custom patchwork to libtool's
        libltdl (which includes the patchwork to support module loading on different
        systems internally)
      
      - conversion of the unit test executor from kyua to automake parallel driver
      
      - conversion of the system test executor from custom make/shell to automake
        parallel driver
      
      - The GSSAPI has been refactored, the custom SPNEGO on the basis that
        all major KRB5/GSSAPI (mit-krb5, heimdal and Windows) implementations
        support SPNEGO mechanism.
      
      - The various defunct tests from bin/tests have been removed:
        bin/tests/optional and bin/tests/pkcs11
      
      - The text files generated from the MD files have been removed, the
        MarkDown has been designed to be readable by both humans and computers
      
      - The xsl header is now generated by a simple sed command instead of
        perl helper
      
      - The <irs/platform.h> header has been removed
      
      - cleanups of configure.ac script to make it more simpler, addition of multiple
        macros (there's still work to be done though)
      
      - the tarball can now be prepared with `make dist`
      
      - the system tests are partially able to run in oot build
      
      Here's a list of unfinished work that needs to be completed in subsequent merge
      requests:
      
      - `make distcheck` doesn't yet work (because of system tests oot run is not yet
        finished)
      
      - documentation is not yet built, there's a different merge request with docbook
        to sphinx-build rst conversion that needs to be rebased and adapted on top of
        the automake
      
      - msvc build is non functional yet and we need to decide whether we will just
        cross-compile bind9 using mingw-w64 or fix the msvc build
      
      - contributed dlz modules are not included neither in the autoconf nor automake
      978c7b2e
  7. 16 Apr, 2020 1 commit
    • Matthijs Mekking's avatar
      dnssec-policy: to sign inline or not · 644f0d95
      Matthijs Mekking authored
      When dnssec-policy was introduced, it implicitly set inline-signing.
      But DNSSEC maintenance required either inline-signing to be enabled,
      or a dynamic zone.  In other words, not in all cases you want to
      DNSSEC maintain your zone with inline-signing.
      
      Change the behavior and determine whether inline-signing is
      required: if the zone is dynamic, don't use inline-signing,
      otherwise implicitly set it.
      
      You can also explicitly set inline-signing to yes with dnssec-policy,
      the restriction that both inline-signing and dnssec-policy cannot
      be set at the same time is now lifted.
      
      However, 'inline-signing no;' on a non-dynamic zone with a
      dnssec-policy is not possible.
      644f0d95
  8. 18 Mar, 2020 1 commit
    • Mark Andrews's avatar
      Refactor the isc_log API so it cannot fail on memory failures · 0b793166
      Mark Andrews authored
      The isc_mem API now crashes on memory allocation failure, and this is
      the next commit in series to cleanup the code that could fail before,
      but cannot fail now, e.g. isc_result_t return type has been changed to
      void for the isc_log API functions that could only return ISC_R_SUCCESS.
      0b793166
  9. 16 Mar, 2020 1 commit
    • Diego Fronza's avatar
      Added RPZ configuration option "nsdname-wait-recurse" · c786c578
      Diego Fronza authored
      This new option was added to fill a gap in RPZ configuration
      options.
      
      It was possible to instruct BIND wheter NSIP rewritting rules would
      apply or not, as long as the required data was already in cache or not,
      respectively, by means of the option nsip-wait-recurse.
      
      A value of yes (default) could incur a little processing cost, since
      BIND would need to recurse to find NS addresses in case they were not in
      the cache.
      
      This behavior could be changed by setting nsip-wait-recurse value to no,
      in which case BIND would promptly return some error code if the NS IP addresses
      data were not in cache, then BIND would start a recursive query
      in background, so future similar requests would have the required data
      (NS IPs) in cache, allowing BIND to apply NSIP rules accordingly.
      
      A similar feature wasn't available for NSDNAME triggers, so this commit
      adds the option nsdname-wait-recurse to fill this gap, as it was
      expected by couple BIND users.
      c786c578
  10. 13 Mar, 2020 2 commits
  11. 09 Mar, 2020 1 commit
  12. 28 Feb, 2020 1 commit
  13. 21 Feb, 2020 1 commit
  14. 18 Feb, 2020 1 commit
  15. 17 Feb, 2020 1 commit
  16. 14 Feb, 2020 1 commit
  17. 13 Feb, 2020 3 commits
    • Evan Hunt's avatar
      apply the modified style · e851ed0b
      Evan Hunt authored
      e851ed0b
    • Ondřej Surý's avatar
      Use clang-tidy to add curly braces around one-line statements · 056e133c
      Ondřej Surý authored
      The command used to reformat the files in this commit was:
      
      ./util/run-clang-tidy \
      	-clang-tidy-binary clang-tidy-11
      	-clang-apply-replacements-binary clang-apply-replacements-11 \
      	-checks=-*,readability-braces-around-statements \
      	-j 9 \
      	-fix \
      	-format \
      	-style=file \
      	-quiet
      clang-format -i --style=format $(git ls-files '*.c' '*.h')
      uncrustify -c .uncrustify.cfg --replace --no-backup $(git ls-files '*.c' '*.h')
      clang-format -i --style=format $(git ls-files '*.c' '*.h')
      056e133c
    • Ondřej Surý's avatar
      Use coccinelle to add braces to nested single line statement · 36c6105e
      Ondřej Surý authored
      Both clang-tidy and uncrustify chokes on statement like this:
      
      for (...)
      	if (...)
      		break;
      
      This commit uses a very simple semantic patch (below) to add braces around such
      statements.
      
      Semantic patch used:
      
      @@
      statement S;
      expression E;
      @@
      
      while (...)
      - if (E) S
      + { if (E) { S } }
      
      @@
      statement S;
      expression E;
      @@
      
      for (...;...;...)
      - if (E) S
      + { if (E) { S } }
      
      @@
      statement S;
      expression E;
      @@
      
      if (...)
      - if (E) S
      + { if (E) { S } }
      36c6105e
  18. 12 Feb, 2020 1 commit
  19. 07 Feb, 2020 1 commit
  20. 05 Feb, 2020 3 commits
    • Mark Andrews's avatar
      'dispatch' must be non NULL, remove test. · 891f24fa
      Mark Andrews authored
      10067 cleanup:
      
      	CID 1452683 (#1 of 1): Dereference before null check (REVERSE_INULL)
      	check_after_deref: Null-checking dispatch suggests that it
      	may be null, but it has already been dereferenced on all
      	paths leading to the check.
      
      10068        if (dispatch != NULL)
      10069                isc_mem_put(server->mctx, dispatch, sizeof(*dispatch));
      891f24fa
    • Mark Andrews's avatar
      'dctx' must be non NULL, remove test. · 8456b562
      Mark Andrews authored
      11030 cleanup:
      
      	CID 1452705 (#1 of 1): Dereference before null check
      	(REVERSE_INULL) check_after_deref: Null-checking dctx
      	suggests that it may be null, but it has already been
      	dereferenced on all paths leading to the check.
      
      11031        if (dctx != NULL)
      11032                dumpcontext_destroy(dctx);
      11033        return (result);
      8456b562
    • Mark Andrews's avatar
      remove dead cleanup code. · b6c3a2f1
      Mark Andrews authored
      13836        if (zone != NULL)
      13837                dns_zone_detach(&zone);
      
           	null: At condition dz != NULL, the value of dz must be NULL.
           	dead_error_condition: The condition dz != NULL cannot be true.
      
      13838        if (dz != NULL) {
      
      	CID 1453456 (#1 of 1): Logically dead code (DEADCODE)
      	dead_error_begin: Execution cannot reach this statement:
      	dns_zone_detach(&dz->zone);.
      
      13839                dns_zone_detach(&dz->zone);
      13840                isc_mem_put(named_g_mctx, dz, sizeof(*dz));
      13841        }
      b6c3a2f1
  21. 03 Feb, 2020 1 commit
  22. 14 Jan, 2020 2 commits
  23. 13 Jan, 2020 2 commits
    • Evan Hunt's avatar
      associate socket stats counters with netmgr socket objects · 80a5c9f5
      Evan Hunt authored
      - the socket stat counters have been moved from socket.h to stats.h.
      - isc_nm_t now attaches to the same stats counter group as
        isc_socketmgr_t, so that both managers can increment the same
        set of statistics
      - isc__nmsocket_init() now takes an interface as a paramter so that
        the address family can be determined when initializing the socket.
      - based on the address family and socket type, a group of statistics
        counters will be associated with the socket - for example, UDP4Active
        with IPv4 UDP sockets and TCP6Active with IPv6 TCP sockets.  note
        that no counters are currently associated with TCPDNS sockets; those
        stats will be handled by the underlying TCP socket.
      - the counters are not actually used by netmgr sockets yet; counter
        increment and decrement calls will be added in a later commit.
      80a5c9f5
    • Tony Finch's avatar
      Fix line spacing in `rndc secroots` · 5b600c2c
      Tony Finch authored
      Before this change, there was a missing blank line between the
      negative trust anchors for one view, and the heading line for the next
      view. This is because dns_ntatable_totext() omits the last newline.
      There is an example of the incorrect output below; the fixed output
      has a blank line before "Start view auth".
      
      secure roots as of 21-Oct-2019 12:03:23.500:
      
       Start view rec
         Secure roots:
      
      ./RSASHA256/20326 ; managed
      
         Negative trust anchors:
      
      example.com: expiry 21-Oct-2019 13:03:15.000
       Start view auth
         Secure roots:
      
      ./RSASHA256/20326 ; managed
      
         Negative trust anchors:
      
      example.com: expiry 21-Oct-2019 13:03:07.000
      5b600c2c
  24. 06 Dec, 2019 1 commit
    • Matthijs Mekking's avatar
      Minor fixes in trust anchor code · eddac857
      Matthijs Mekking authored
      This commit makes some minor changes to the trust anchor code:
      
      1. Replace the undescriptive n1, n2 and n3 identifiers with slightly
         better rdata1, rdata2, and rdata3.
      2. Fix an occurrence where in the error log message a static number
         32 was printed, rather than the rdata3 length.
      3. Add a default case to the switch statement checking DS digest
         algorithms to catch unknown algorithms.
      eddac857
  25. 05 Dec, 2019 1 commit
  26. 04 Dec, 2019 1 commit
    • Ondřej Surý's avatar
      Refactor the dns_geoip API to use ISC_THREAD_LOCAL · a4ffb640
      Ondřej Surý authored
      Previously, the dns_geoip API used isc_thread_key API for TLS, which is
      fairly complicated and requires initialization of memory contexts, etc.
      This part of code was refactored to use a ISC_THREAD_LOCAL pointer which
      greatly simplifies the whole code related to storing TLS variables, and
      creating the local memory context was moved to named and stored in the
      named_g_geoip global context.
      a4ffb640
  27. 03 Dec, 2019 1 commit
    • Ondřej Surý's avatar
      Refactor the dns_dt API to use ISC_THREAD_LOCAL · 4a3d5894
      Ondřej Surý authored
      Previously, the dns_dt API used isc_thread_key API for TLS, which is
      fairly complicated and requires initialization of memory contexts, etc.
      This part of code was refactored to use a ISC_THREAD_LOCAL pointer which
      greatly simplifies the whole code related to storing TLS variables.
      4a3d5894
  28. 02 Dec, 2019 1 commit
    • Michał Kępień's avatar
      Fix GeoIP2 memory leak upon reconfiguration · 670afbe8
      Michał Kępień authored
      Loaded GeoIP2 databases are only released when named is shut down, but
      not during server reconfiguration.  This causes memory to be leaked
      every time "rndc reconfig" or "rndc reload" is used, as long as any
      GeoIP2 database is in use.  Fix by releasing any loaded GeoIP2 databases
      before reloading them.  Do not call dns_geoip_shutdown() until server
      shutdown as that function releases the memory context used for caching
      GeoIP2 lookup results.
      670afbe8
  29. 29 Nov, 2019 1 commit
  30. 26 Nov, 2019 1 commit
    • Ondřej Surý's avatar
      Request exclusive access when crashing via fatal() · 952d7fde
      Ondřej Surý authored
      When loading the configuration fails, there might be already other tasks
      running and calling OpenSSL library functions.  The OpenSSL on_exit
      handler is called when exiting the main process and there's a timing
      race between the on_exit function that destroys OpenSSL allocated
      resources (threads, locks, ...) and other tasks accessing the very same
      resources leading to a crash in the system threading library. Therefore,
      the fatal() function needs to request exlusive access to the task
      manager to finish the already running tasks and exit only when no other
      tasks are running.
      952d7fde
  31. 23 Nov, 2019 1 commit
    • Evan Hunt's avatar
      netmgr: make TCP timeouts configurable · 199bd6b6
      Evan Hunt authored
      - restore support for tcp-initial-timeout, tcp-idle-timeout,
        tcp-keepalive-timeout and tcp-advertised-timeout configuration
        options, which were ineffective previously.
      199bd6b6
  32. 18 Nov, 2019 1 commit
  33. 15 Nov, 2019 1 commit