This patch fixes a locking bug when a send() call blocks

on an SCTP socket and the association is aborted by the
peer.

Approved by:	re (kib)
MFC after:	1 week
This commit is contained in:
tuexen 2016-06-26 12:41:02 +00:00
parent 51458c487b
commit 37b02e3df9

View File

@ -13136,6 +13136,7 @@ sctp_lower_sosend(struct socket *so,
asoc, stcb->asoc.total_output_queue_size); asoc, stcb->asoc.total_output_queue_size);
} }
if (stcb->asoc.state & SCTP_STATE_ABOUT_TO_BE_FREED) { if (stcb->asoc.state & SCTP_STATE_ABOUT_TO_BE_FREED) {
SOCKBUF_UNLOCK(&so->so_snd);
goto out_unlocked; goto out_unlocked;
} }
inqueue_bytes = stcb->asoc.total_output_queue_size - (stcb->asoc.chunks_on_out_queue * sizeof(struct sctp_data_chunk)); inqueue_bytes = stcb->asoc.total_output_queue_size - (stcb->asoc.chunks_on_out_queue * sizeof(struct sctp_data_chunk));