Date: Mon, 15 Jul 2019 14:52:53 +0000 (UTC) From: Michael Tuexen <tuexen@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r349998 - head/sys/netinet Message-ID: <201907151452.x6FEqrDI020521@repo.freebsd.org>
next in thread | raw e-mail | index | archive | help
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);
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201907151452.x6FEqrDI020521>