1. 06 May, 2019 5 commits
  2. 02 May, 2019 2 commits
  3. 26 Apr, 2019 11 commits
  4. 25 Apr, 2019 12 commits
    • Ondřej Surý's avatar
      Merge branch '615-tcp-client-crash-v9_14-master' into 'master' · 2c85466c
      Ondřej Surý authored
      Resolve "tcp-clients mostly ineffective"
      
      Closes #615
      
      See merge request !1871
      2c85466c
    • Evan Hunt's avatar
      CHANGES, release note · 4551c58e
      Evan Hunt authored
      (cherry picked from commit 244e44af432121a05e0a308b7ccce96a8ecd28ab)
      (cherry picked from commit 79fad84b)
      4551c58e
    • Evan Hunt's avatar
      restore allowance for tcp-clients < interfaces · d809ec6c
      Evan Hunt authored
      in the "refactor tcpquota and pipeline refs" commit, the counting
      of active interfaces was tightened in such a way that named could
      fail to listen on an interface if there were more interfaces than
      tcp-clients. when checking the quota to start accepting on an
      interface, if the number of active clients was above zero, then
      it was presumed that some other client was able to handle accepting
      new connections. this, however, ignored the fact that the current client
      could be included in that count, so if the quota was already exceeded
      before all the interfaces were listening, some interfaces would never
      listen.
      
      we now check whether the current client has been marked active; if so,
      then the number of active clients on the interface must be greater
      than 1, not 0.
      
      (cherry picked from commit 02365b87ea0b1ea5ea8b17376f6734c811c95e61)
      (cherry picked from commit cae79e1b)
      d809ec6c
    • Evan Hunt's avatar
      refactor tcpquota and pipeline refs; allow special-case overrun in isc_quota · 2f3876d1
      Evan Hunt authored
      - if the TCP quota has been exceeded but there are no clients listening
        for new connections on the interface, we can now force attachment to the
        quota using isc_quota_force(), instead of carrying on with the quota not
        attached.
      - the TCP client quota is now referenced via a reference-counted
        'ns_tcpconn' object, one of which is created whenever a client begins
        listening for new connections, and attached to by members of that
        client's pipeline group. when the last reference to the tcpconn
        object is detached, it is freed and the TCP quota slot is released.
      - reduce code duplication by adding mark_tcp_active() function
      - convert counters to stdatomic
      
      (cherry picked from commit a8dd133d270873b736c1be9bf50ebaa074f5b38f)
      (cherry picked from commit 4a8fc979)
      2f3876d1
    • Evan Hunt's avatar
      better tcpquota accounting and client mortality checks · a0f4a3fa
      Evan Hunt authored
      - ensure that tcpactive is cleaned up correctly when accept() fails.
      - set 'client->tcpattached' when the client is attached to the tcpquota.
        carry this value on to new clients sharing the same pipeline group.
        don't call isc_quota_detach() on the tcpquota unless tcpattached is
        set.  this way clients that were allowed to accept TCP connections
        despite being over quota (and therefore, were never attached to the
        quota) will not inadvertently detach from it and mess up the
        accounting.
      - simplify the code for tcpquota disconnection by using a new function
        tcpquota_disconnect().
      - before deciding whether to reject a new connection due to quota
        exhaustion, check to see whether there are at least two active
        clients. previously, this was "at least one", but that could be
        insufficient if there was one other client in READING state (waiting
        for messages on an open connection) but none in READY (listening
        for new connections).
      - before deciding whether a TCP client object can to go inactive, we
        must ensure there are enough other clients to maintain service
        afterward -- both accepting new connections and reading/processing new
        queries.  A TCP client can't shut down unless at least one
        client is accepting new connections and (in the case of pipelined
        clients) at least one additional client is waiting to read.
      
      (cherry picked from commit 427a2fb4d17bc04ca3262f58a9dcf5c93fc6d33e)
      (cherry picked from commit 08968412)
      a0f4a3fa
    • Michał Kępień's avatar
      use reference counter for pipeline groups (v3) · 3c0f8d91
      Michał Kępień authored
      Track pipeline groups using a shared reference counter
      instead of a linked list.
      
      (cherry picked from commit 31f392db20207a1b05d6286c3c56f76c8d69e574)
      (cherry picked from commit 22111202)
      3c0f8d91
    • Witold Krecicki's avatar
      tcp-clients could still be exceeded (v2) · d989a8b3
      Witold Krecicki authored
      the TCP client quota could still be ineffective under some
      circumstances.  this change:
      
      - improves quota accounting to ensure that TCP clients are
        properly limited, while still guaranteeing that at least one client
        is always available to serve TCP connections on each interface.
      - uses more descriptive names and removes one (ntcptarget) that
        was no longer needed
      - adds comments
      
      (cherry picked from commit 9e74969f85329fe26df2fad390468715215e2edd)
      (cherry picked from commit d7e84cee)
      d989a8b3
    • Witold Krecicki's avatar
      fix enforcement of tcp-clients (v1) · 07c3365b
      Witold Krecicki authored
      tcp-clients settings could be exceeded in some cases by
      creating more and more active TCP clients that are over
      the set quota limit, which in the end could lead to a
      DoS attack by e.g. exhaustion of file descriptors.
      
      If TCP client we're closing went over the quota (so it's
      not attached to a quota) mark it as mortal - so that it
      will be destroyed and not set up to listen for new
      connections - unless it's the last client for a specific
      interface.
      
      (cherry picked from commit eafcff07c25bdbe038ae1e4b6660602a080b9395)
      (cherry picked from commit 9e7617cc)
      07c3365b
    • Ondřej Surý's avatar
      Merge branch '880-secure-asdfasdfasdf-abacadabra-crash-v9_14-master' into 'master' · 7ef39530
      Ondřej Surý authored
      Resolve "CVE-2019-6467: lib/ns/query.c:9176: INSIST(!qctx->is_zone) failed, back trace"
      
      Closes #880
      
      See merge request !1868
      7ef39530
    • Evan Hunt's avatar
      CHANGES, release note · 38c29c1b
      Evan Hunt authored
      (cherry picked from commit ab5473007e91f011d003ff0ba5ab32fa0d56360c)
      (cherry picked from commit 404be595)
      38c29c1b
    • Matthijs Mekking's avatar
      Fix nxdomain-redirect assertion failure · f3d3703f
      Matthijs Mekking authored
      - Always set is_zonep in query_getdb; previously it was only set if
        result was ISC_R_SUCCESS or ISC_R_NOTFOUND.
      - Don't reset is_zone for redirect.
      - Style cleanup.
      
      (cherry picked from commit a85cc641d7a4c66cbde03cc4e31edc038a24df46)
      (cherry picked from commit 486a2011)
      f3d3703f
    • Matthijs Mekking's avatar
      Add test for nxdomain-redirect ncachenxdomain · 2fbadaee
      Matthijs Mekking authored
      (cherry picked from commit 2d65626630c19bb8159a025accb18e5179da5dc3)
      (cherry picked from commit 05d29443)
      2fbadaee
  5. 23 Apr, 2019 10 commits