svn commit: r343951 - head/sys/netinet

Michael Tuexen tuexen at FreeBSD.org
Sun Feb 10 08:28:57 UTC 2019


Author: tuexen
Date: Sun Feb 10 08:28:56 2019
New Revision: 343951
URL: https://svnweb.freebsd.org/changeset/base/343951

Log:
  Fix locking for IPPROTO_SCTP level SCTP_DEFAULT_PRINFO socket option.
  This problem occurred when calling setsockopt() will invalid parameters.
  
  This issue was found by running syzkaller.
  
  MFC after:		3 days

Modified:
  head/sys/netinet/sctp_usrreq.c

Modified: head/sys/netinet/sctp_usrreq.c
==============================================================================
--- head/sys/netinet/sctp_usrreq.c	Sun Feb 10 08:14:06 2019	(r343950)
+++ head/sys/netinet/sctp_usrreq.c	Sun Feb 10 08:28:56 2019	(r343951)
@@ -6209,6 +6209,9 @@ sctp_setopt(struct socket *so, int optname, void *optv
 			SCTP_FIND_STCB(inp, stcb, info->pr_assoc_id);
 
 			if (info->pr_policy > SCTP_PR_SCTP_MAX) {
+				if (stcb) {
+					SCTP_TCB_UNLOCK(stcb);
+				}
 				SCTP_LTRACE_ERR_RET(inp, NULL, NULL, SCTP_FROM_SCTP_USRREQ, EINVAL);
 				error = EINVAL;
 				break;


More information about the svn-src-head mailing list