summaryrefslogtreecommitdiffstats
path: root/sys/netinet
diff options
context:
space:
mode:
authortuexen <tuexen@FreeBSD.org>2013-02-27 19:51:47 +0000
committertuexen <tuexen@FreeBSD.org>2013-02-27 19:51:47 +0000
commit8c2c9fac8bcaac70121251ccda4407c827e44eed (patch)
treedcc437946f5ab5e17c4f57fbfd6a6ff11c60879c /sys/netinet
parent2b2e6341820f4bf973e758ae57713a8e6d356a3a (diff)
downloadFreeBSD-src-8c2c9fac8bcaac70121251ccda4407c827e44eed.zip
FreeBSD-src-8c2c9fac8bcaac70121251ccda4407c827e44eed.tar.gz
Fix a potential race in returning setting errno when an
association goes down. Reported by Mozilla in https://bugzilla.mozilla.org/show_bug.cgi?id=845513 MFC after: 3 days
Diffstat (limited to 'sys/netinet')
-rw-r--r--sys/netinet/sctputil.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/sys/netinet/sctputil.c b/sys/netinet/sctputil.c
index fe2b945..7bd8c7a9 100644
--- a/sys/netinet/sctputil.c
+++ b/sys/netinet/sctputil.c
@@ -2678,6 +2678,7 @@ set_error:
if (((stcb->sctp_ep->sctp_flags & SCTP_PCB_FLAGS_TCPTYPE) ||
(stcb->sctp_ep->sctp_flags & SCTP_PCB_FLAGS_IN_TCPPOOL)) &&
((state == SCTP_COMM_LOST) || (state == SCTP_CANT_STR_ASSOC))) {
+ SOCK_LOCK(stcb->sctp_socket);
if (from_peer) {
if (SCTP_GET_STATE(&stcb->asoc) == SCTP_STATE_COOKIE_WAIT) {
SCTP_LTRACE_ERR_RET(NULL, stcb, NULL, SCTP_FROM_SCTPUTIL, ECONNREFUSED);
@@ -2709,7 +2710,7 @@ set_error:
if (((stcb->sctp_ep->sctp_flags & SCTP_PCB_FLAGS_TCPTYPE) ||
(stcb->sctp_ep->sctp_flags & SCTP_PCB_FLAGS_IN_TCPPOOL)) &&
((state == SCTP_COMM_LOST) || (state == SCTP_CANT_STR_ASSOC))) {
- socantrcvmore(stcb->sctp_socket);
+ socantrcvmore_locked(stcb->sctp_socket);
}
sorwakeup(stcb->sctp_socket);
sowwakeup(stcb->sctp_socket);
OpenPOWER on IntegriCloud