]> git.ipfire.org Git - thirdparty/bind9.git/commit
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)
commit60ec9ef50759f9e0f7dc049de72c8fce4b2d30eb
tree1645a97b315bf22045f0b9c56497f1634b588f06
parent4b47c96a890c0cbbe7a0ff6510059ae04d7d69ec
parentdbf230650f74d40fc1e1b45e1445d174802ede1b
fix: dev: Fix a data race between dns_zone_getxfr() and dns_xfrin_create()

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