From: Arаm Sаrgsyаn Date: Thu, 7 Nov 2024 09:58:47 +0000 (+0000) Subject: fix: dev: Fix a data race between dns_zone_getxfr() and dns_xfrin_create() X-Git-Tag: v9.21.3~41 X-Git-Url: http://git.ipfire.org/gitweb/index.cgi?a=commitdiff_plain;h=60ec9ef50759f9e0f7dc049de72c8fce4b2d30eb;p=thirdparty%2Fbind9.git 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 --- 60ec9ef50759f9e0f7dc049de72c8fce4b2d30eb