bind9/lib/isc/netmgr
Witold Kręcicki fd8788eb94 Fix possible race in socket destruction.
When two threads unreferenced handles coming from one socket while
the socket was being destructed we could get a use-after-free:
Having handle H1 coming from socket S1, H2 coming from socket S2,
S0 being a parent socket to S1 and S2:

Thread A                             Thread B
Unref handle H1                      Unref handle H2
Remove H1 from S1 active handles     Remove H2 from S2 active handles
nmsocket_maybe_destroy(S1)           nmsocket_maybe_destroy(S2)
nmsocket_maybe_destroy(S0)           nmsocket_maybe_destroy(S0)
LOCK(S0->lock)
Go through all children, figure
out that we have no more active
handles:
sum of S0->children[i]->ah == 0
UNLOCK(S0->lock)
destroy(S0)
                                     LOCK(S0->lock)
                                      - but S0 is already gone
2020-01-20 22:28:36 +01:00
..
Makefile.in Add isc_uv_export()/isc_uv_import() functions to libuv compatibility layer. 2020-01-13 10:52:07 -08:00
netmgr-int.h netmgr: fix a non-thread-safe access to libuv structures 2020-01-20 22:28:36 +01:00
netmgr.c Fix possible race in socket destruction. 2020-01-20 22:28:36 +01:00
tcp.c netmgr: fix a non-thread-safe access to libuv structures 2020-01-20 22:28:36 +01:00
tcpdns.c clean up some handle/client reference counting errors in error cases. 2020-01-20 22:28:36 +01:00
udp.c calling isc__nm_udp_send() on a non-udp socket is not 'unexpected', it's a critical failure 2020-01-20 22:28:36 +01:00
uv-compat.c netmgr: 2020-01-15 14:08:44 +01:00
uv-compat.h Add isc_uv_export()/isc_uv_import() functions to libuv compatibility layer. 2020-01-13 10:52:07 -08:00
uverr2result.c Add out-of-tree build to the CI 2020-01-09 10:16:06 +01:00