]> 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)
committerWitold Kręcicki <wpk@isc.org>
Tue, 3 Mar 2020 08:26:54 +0000 (09:26 +0100)
commite4d39f57ff161a03bd6f16439ea54462a507f3d7
tree15bec4781c4d339c7a817e7612150d1afdcd291f
parentb9a9407514c76b29c73f2314d0851198f67fde30
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.

(cherry picked from commit 81ba0fe0e6b33909d0b8bec99f9ea9af072f6f5d)
lib/isc/unix/socket.c