mirror of
https://git.FreeBSD.org/src.git
synced 2024-11-30 08:19:09 +00:00
81158452be
(sorele()/sotryfree()): - This permits the caller to acquire the accept mutex before the socket mutex, avoiding sofree() having to drop the socket mutex and re-order, which could lead to races permitting more than one thread to enter sofree() after a socket is ready to be free'd. - This also covers clearing of the so_pcb weak socket reference from the protocol to the socket, preventing races in clearing and evaluation of the reference such that sofree() might be called more than once on the same socket. This appears to close a race I was able to easily trigger by repeatedly opening and resetting TCP connections to a host, in which the tcp_close() code called as a result of the RST raced with the close() of the accepted socket in the user process resulting in simultaneous attempts to de-allocate the same socket. The new locking increases the overhead for operations that may potentially free the socket, so we will want to revise the synchronization strategy here as we normalize the reference counting model for sockets. The use of the accept mutex in freeing of sockets that are not listen sockets is primarily motivated by the potential need to remove the socket from the incomplete connection queue on its parent (listen) socket, so cleaning up the reference model here may allow us to substantially weaken the synchronization requirements. RELENG_5_3 candidate. MFC after: 3 days Reviewed by: dwhite Discussed with: gnn, dwhite, green Reported by: Marc UBM Bocklet <ubm at u-boot-man dot de> Reported by: Vlad <marchenko at gmail dot com> |
||
---|---|---|
.. | ||
aarp.c | ||
aarp.h | ||
at_control.c | ||
at_extern.h | ||
at_proto.c | ||
at_rmx.c | ||
at_var.h | ||
at.h | ||
COPYRIGHT | ||
ddp_input.c | ||
ddp_output.c | ||
ddp_pcb.c | ||
ddp_pcb.h | ||
ddp_usrreq.c | ||
ddp_var.h | ||
ddp.h | ||
endian.h | ||
phase2.h |