svn commit: r349998 - head/sys/netinet

Michael Tuexen tuexen at FreeBSD.org
Mon Jul 15 14:52:53 UTC 2019


Author: tuexen
Date: Mon Jul 15 14:52:52 2019
New Revision: 349998
URL: https://svnweb.freebsd.org/changeset/base/349998

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

Modified:
  head/sys/netinet/sctp_pcb.c

Modified: head/sys/netinet/sctp_pcb.c
==============================================================================
--- head/sys/netinet/sctp_pcb.c	Mon Jul 15 14:23:51 2019	(r349997)
+++ head/sys/netinet/sctp_pcb.c	Mon Jul 15 14:52:52 2019	(r349998)
@@ -4912,12 +4912,11 @@ sctp_free_assoc(struct sctp_inpcb *inp, struct sctp_tc
 			inp->sctp_flags |= SCTP_PCB_FLAGS_WAS_CONNECTED;
 			if (so) {
 				SOCKBUF_LOCK(&so->so_rcv);
-				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);


More information about the svn-src-all mailing list