]> git.ipfire.org Git - thirdparty/pdns.git/commit
dnsdist: Fix a crash in the Downstream TCP handler 14041/head
authorRemi Gacogne <remi.gacogne@powerdns.com>
Fri, 5 Apr 2024 10:44:17 +0000 (12:44 +0200)
committerRemi Gacogne <remi.gacogne@powerdns.com>
Fri, 5 Apr 2024 10:44:17 +0000 (12:44 +0200)
commit3594ea139e032cabf555ecde6c696e90921ce39f
tree6ef4af71c1150467d2547207838c891fe81acdb4
parent36778847eac7d134ffe95160398c2866125270c6
dnsdist: Fix a crash in the Downstream TCP handler

when we are looking for an existing TCP connection to a backend to
reuse, we routinely (every 60s by default) clean up existing
connections from the cache.
7b5f590ee72fecf54c0c40b24e98ba03a406af53 removes a connection
from the cache more aggressively when it has failed, but I did not
notice that the same function might be called from the cache cleaning
algorithm. It caused the cache cleanup function to call this function
which in turns tried to remove the connection from the same cache,
invalidating the iterator of the cache algorithm, and causing a crash
when the function returned.
pdns/dnsdistdist/dnsdist-downstream-connection.hh
pdns/dnsdistdist/dnsdist-nghttp2.cc
pdns/dnsdistdist/dnsdist-tcp-downstream.cc
pdns/dnsdistdist/dnsdist-tcp-downstream.hh
pdns/dnsdistdist/dnsdist-tcp.cc
pdns/dnsdistdist/test-dnsdist-connections-cache.cc