]> git.ipfire.org Git - thirdparty/bind9.git/commitdiff
XoT: properly handle the case when checking for ALPN failed
authorArtem Boldariev <artem@boldariev.com>
Thu, 12 Jan 2023 18:09:51 +0000 (20:09 +0200)
committerArtem Boldariev <artem@boldariev.com>
Tue, 17 Jan 2023 17:00:19 +0000 (19:00 +0200)
During XoT it is important to check for "dot" ALPN tag to be
negotiated (according to the RFC 9103). We were doing that, however, the
situation was not handled properly, leading to non-cancelled zone
transfers that would crash (abort()) BIND on shutdown.

In this particular case 'result' might equal 'ISC_R_SUCCESS'. When
this is the case, the part of the code supposed to handle failures
will not cancel the zone transfer.

This situation cannot happen when BIND is a secondary of other BIND
instance. Only primaries following the RFC not closely enough could
trigger such a behaviour.

lib/dns/xfrin.c

index b2ed51b8e41c8fd16595c4a3bfd07c61c5ef75a6..c4723925c2446b4f6e2f2430325ff2696bfd763c 100644 (file)
@@ -1021,6 +1021,8 @@ xfrin_connect_done(isc_nmhandle_t *handle, isc_result_t result, void *cbarg) {
        CHECK(result);
 
        if (!isc_nm_xfr_allowed(handle)) {
+               /* set the error code so that XFER will fail */
+               result = ISC_R_NOPERM;
                goto failure;
        }