mirror of
https://github.com/isc-projects/bind9.git
synced 2026-03-09 17:50:52 -04:00
The xfrin_end() function is run when a zone transfer is finished or canceled. One of the actions it takes for incremental transfers (IXFR) is calling dns_journal_destroy() on the zone journal structure that is stored in the relevant zone transfer context (xfr->ixfr.journal). That immediately invalidates that structure as it is not reference-counted. However, since the changes present in the IXFR stream are applied to the journal asynchronously (via isc_work_enqueue()), it is possible that some zone changes may still be in the process of being written to the journal by the time xfrin_end() destroys the relevant structure. Such a scenario leads to crashes. Fix by not destroying the zone journal structure until the entire zone transfer context is destroyed. xfrin_destroy() already conditionally calls dns_journal_destroy() and when the former is called, all asynchronous work for a given zone transfer process is guaranteed to be complete.
30 lines
1.1 KiB
D
30 lines
1.1 KiB
D
/*
|
|
* Copyright (C) Internet Systems Consortium, Inc. ("ISC")
|
|
*
|
|
* SPDX-License-Identifier: MPL-2.0
|
|
*
|
|
* This Source Code Form is subject to the terms of the Mozilla Public
|
|
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
|
* file, you can obtain one at https://mozilla.org/MPL/2.0/.
|
|
*
|
|
* See the COPYRIGHT file distributed with this work for additional
|
|
* information regarding copyright ownership.
|
|
*/
|
|
|
|
provider libdns {
|
|
probe xfrin_axfr_finalize_begin(void *, char *);
|
|
probe xfrin_axfr_finalize_end(void *, char *, int);
|
|
probe xfrin_connected(void *, char *, int);
|
|
probe xfrin_done_callback_begin(void *, char *, int);
|
|
probe xfrin_done_callback_end(void *, char *, int);
|
|
probe xfrin_read(void *, char *, int);
|
|
probe xfrin_recv_answer(void *, char *, void *);
|
|
probe xfrin_recv_done(void *, char *, int);
|
|
probe xfrin_recv_parsed(void *, char *, int);
|
|
probe xfrin_recv_question(void *, char *, void *);
|
|
probe xfrin_recv_send_request(void *, char *);
|
|
probe xfrin_recv_start(void *, char *, int);
|
|
probe xfrin_recv_try_axfr(void *, char *, int);
|
|
probe xfrin_sent(void *, char *, int);
|
|
probe xfrin_start(void *, char *);
|
|
};
|