Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 15 Sep 2020 23:03:57 +0000 (UTC)
From:      Mark Johnston <markj@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r365788 - head/sys/kern
Message-ID:  <202009152303.08FN3vkb095633@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: markj
Date: Tue Sep 15 23:03:56 2020
New Revision: 365788
URL: https://svnweb.freebsd.org/changeset/base/365788

Log:
  Fix locking in uipc_accept().
  
  Reported by:	cy
  MFC after:	1 week
  Sponsored by:	The FreeBSD Foundation

Modified:
  head/sys/kern/uipc_usrreq.c

Modified: head/sys/kern/uipc_usrreq.c
==============================================================================
--- head/sys/kern/uipc_usrreq.c	Tue Sep 15 22:19:16 2020	(r365787)
+++ head/sys/kern/uipc_usrreq.c	Tue Sep 15 23:03:56 2020	(r365788)
@@ -506,7 +506,10 @@ uipc_accept(struct socket *so, struct sockaddr **nam)
 	else
 		sa = &sun_noname;
 	bcopy(sa, *nam, sa->sa_len);
-	unp_pcb_unlock_pair(unp, unp2);
+	if (unp2 != NULL)
+		unp_pcb_unlock_pair(unp, unp2);
+	else
+		UNP_PCB_UNLOCK(unp);
 	return (0);
 }
 



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