]> git.ipfire.org Git - thirdparty/bind9.git/commit
Fix a race in isc_socket destruction.
authorWitold Kręcicki <wpk@isc.org>
Wed, 5 Feb 2020 11:35:54 +0000 (12:35 +0100)
committerOndřej Surý <ondrej@isc.org>
Tue, 3 Mar 2020 07:34:19 +0000 (08:34 +0100)
commit81ba0fe0e6b33909d0b8bec99f9ea9af072f6f5d
tree84b5d753a685781687efc73e6e7fbfcab95ed22b
parent3c15372c2b506e8e3b68487f804f50bc298f2f68
Fix a race in isc_socket destruction.

There was a very slim chance of a race between isc_socket_detach and
process_fd: isc_socket_detach decrements references to 0, and before it
calls destroy gets preempted. Second thread calls process_fd, increments
socket references temporarily to 1, and then gets preempted, first thread
then hits assertion in destroy() as the reference counter is now 1 and
not 0.
lib/isc/unix/socket.c