Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 6 May 2020 22:02:01 +0000 (UTC)
From:      Michael Tuexen <tuexen@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org
Subject:   svn commit: r360706 - stable/11/sys/netinet
Message-ID:  <202005062202.046M21oa025746@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: tuexen
Date: Wed May  6 22:02:01 2020
New Revision: 360706
URL: https://svnweb.freebsd.org/changeset/base/360706

Log:
  MFC r349998: Improve SCTP socket state handling
  
  Fix socket state handling when freeing an SCTP endpoint.
  This issue was found by runing syzkaller.

Modified:
  stable/11/sys/netinet/sctp_pcb.c
Directory Properties:
  stable/11/   (props changed)

Modified: stable/11/sys/netinet/sctp_pcb.c
==============================================================================
--- stable/11/sys/netinet/sctp_pcb.c	Wed May  6 21:59:58 2020	(r360705)
+++ stable/11/sys/netinet/sctp_pcb.c	Wed May  6 22:02:01 2020	(r360706)
@@ -4911,12 +4911,11 @@ sctp_free_assoc(struct sctp_inpcb *inp, struct sctp_tc
 			inp->sctp_flags |= SCTP_PCB_FLAGS_WAS_CONNECTED;
 			if (so) {
 				SOCK_LOCK(so);
-				if (so->so_rcv.sb_cc == 0) {
-					so->so_state &= ~(SS_ISCONNECTING |
-					    SS_ISDISCONNECTING |
-					    SS_ISCONFIRMING |
-					    SS_ISCONNECTED);
-				}
+				so->so_state &= ~(SS_ISCONNECTING |
+				    SS_ISDISCONNECTING |
+				    SS_ISCONFIRMING |
+				    SS_ISCONNECTED);
+				so->so_state |= SS_ISDISCONNECTED;
 				socantrcvmore_locked(so);
 				socantsendmore(so);
 				sctp_sowwakeup(inp, so);



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?202005062202.046M21oa025746>