]> git.ipfire.org Git - thirdparty/bind9.git/commitdiff
fix: dev: Fix a data race between dns_zone_getxfr() and dns_xfrin_create()
authorArаm Sаrgsyаn <aram@isc.org>
Thu, 7 Nov 2024 09:58:47 +0000 (09:58 +0000)
committerArаm Sаrgsyаn <aram@isc.org>
Thu, 7 Nov 2024 09:58:47 +0000 (09:58 +0000)
There is a data race between the statistics channel, which uses
`dns_zone_getxfr()` to get a reference to `zone->xfr`, and the creation
of `zone->xfr`, because the latter happens outside of a zone lock.

Split the `dns_xfrin_create()` function into two parts to separate the
zone transfer starting part from the zone transfer object creation part.
This allows us to attach the new object to a local variable first, then
attach it to `zone->xfr` under a lock, and only then start the transfer.

Closes #5011

Merge branch '5011-dns_zone_getxfr-race-fix' into 'main'

See merge request isc-projects/bind9!9716


Trivial merge