]> git.ipfire.org Git - thirdparty/pdns.git/commitdiff
Be sure to hold a read lock during Lua queries.
authorMiod Vallat <miod.vallat@powerdns.com>
Mon, 20 Apr 2026 06:32:28 +0000 (08:32 +0200)
committerMiod Vallat <miod.vallat@powerdns.com>
Mon, 20 Apr 2026 06:35:11 +0000 (08:35 +0200)
Fixes: #17158
Signed-off-by: Miod Vallat <miod.vallat@powerdns.com>
modules/geoipbackend/geoipbackend.cc
modules/geoipbackend/geoipbackend.hh

index 6ba676be8e457cec4c0bf18c2953487d7e530dc6..df41c5ab6a2fb0751839349624323171f571d01c 100644 (file)
@@ -730,6 +730,7 @@ static string queryGeoIP(const Netmask& addr, GeoIPInterface::GeoIPQueryAttribut
 
 string getGeoForLua(const std::string& ip, int qaint)
 {
+  ReadLock rl(&GeoIPBackend::s_state_lock);
   GeoIPInterface::GeoIPQueryAttribute qa((GeoIPInterface::GeoIPQueryAttribute)qaint);
   try {
     const Netmask addr{ip};
index b597c7dc2729ae05430267bd3b74830e848f482f..9c670f1687f2e4f9631a681772773850669717d7 100644 (file)
@@ -84,9 +84,9 @@ public:
   bool publishDomainKey(const ZoneName& name, unsigned int keyId) override;
   bool unpublishDomainKey(const ZoneName& name, unsigned int keyId) override;
 
-private:
   static ReadWriteLock s_state_lock;
 
+private:
   void initialize();
   string format2str(string format, const Netmask& addr, GeoIPNetmask& gl, const GeoIPDomain& dom);
   bool d_dnssec{};