From owner-svn-ports-all@freebsd.org Mon Jun 3 12:46:26 2019 Return-Path: Delivered-To: svn-ports-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5DBC015B0541; Mon, 3 Jun 2019 12:46:26 +0000 (UTC) (envelope-from mat@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 02076768D4; Mon, 3 Jun 2019 12:46:26 +0000 (UTC) (envelope-from mat@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id C955065E0; Mon, 3 Jun 2019 12:46:25 +0000 (UTC) (envelope-from mat@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x53CkPCG086960; Mon, 3 Jun 2019 12:46:25 GMT (envelope-from mat@FreeBSD.org) Received: (from mat@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x53CkP20086959; Mon, 3 Jun 2019 12:46:25 GMT (envelope-from mat@FreeBSD.org) Message-Id: <201906031246.x53CkP20086959@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mat set sender to mat@FreeBSD.org using -f From: Mathieu Arnold Date: Mon, 3 Jun 2019 12:46:25 +0000 (UTC) To: ports-committers@freebsd.org, svn-ports-all@freebsd.org, svn-ports-branches@freebsd.org Subject: svn commit: r503383 - in branches/2019Q2/dns/bind914: . files X-SVN-Group: ports-branches X-SVN-Commit-Author: mat X-SVN-Commit-Paths: in branches/2019Q2/dns/bind914: . files X-SVN-Commit-Revision: 503383 X-SVN-Commit-Repository: ports MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 02076768D4 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.96 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.96)[-0.959,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-ports-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the ports tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 03 Jun 2019 12:46:26 -0000 Author: mat Date: Mon Jun 3 12:46:25 2019 New Revision: 503383 URL: https://svnweb.freebsd.org/changeset/ports/503383 Log: MFH: r503379 Fix a possible race between udp dispatch and socket code. PR: 237640 Obtained from: https://gitlab.isc.org/isc-projects/bind9/merge_requests/1992 Added: branches/2019Q2/dns/bind914/files/patch-lib_isc_unix_socket.c - copied unchanged from r503379, head/dns/bind914/files/patch-lib_isc_unix_socket.c Modified: branches/2019Q2/dns/bind914/Makefile Directory Properties: branches/2019Q2/ (props changed) Modified: branches/2019Q2/dns/bind914/Makefile ============================================================================== --- branches/2019Q2/dns/bind914/Makefile Mon Jun 3 12:43:33 2019 (r503382) +++ branches/2019Q2/dns/bind914/Makefile Mon Jun 3 12:46:25 2019 (r503383) @@ -8,7 +8,7 @@ PORTVERSION= ${ISCVERSION:S/-P/P/:S/b/.b/:S/a/.a/:S/rc PORTREVISION= 0 .else # dns/bind913 here -PORTREVISION= 0 +PORTREVISION= 1 .endif CATEGORIES= dns net ipv6 MASTER_SITES= ISC/bind9/${ISCVERSION} Copied: branches/2019Q2/dns/bind914/files/patch-lib_isc_unix_socket.c (from r503379, head/dns/bind914/files/patch-lib_isc_unix_socket.c) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ branches/2019Q2/dns/bind914/files/patch-lib_isc_unix_socket.c Mon Jun 3 12:46:25 2019 (r503383, copy of r503379, head/dns/bind914/files/patch-lib_isc_unix_socket.c) @@ -0,0 +1,35 @@ +From e517c18d98c248e891558ce5194e3663d244f956 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Witold=20Kr=C4=99cicki?= +Date: Fri, 31 May 2019 10:40:52 +0200 +Subject: [PATCH 1/2] Fix a possible race between udp dispatch and socket code + +There's a small possibility of race between udp dispatcher and +socket code - socket code can still hold internal reference to a +socket while dispatcher calls isc_socket_open, which can cause +an assertion failure. Fix it by relaxing the assertion test, and +instead simply locking the socket in isc_socket_open. + +--- lib/isc/unix/socket.c.orig 2019-05-10 04:51:34 UTC ++++ lib/isc/unix/socket.c +@@ -2598,15 +2598,16 @@ isc_socket_open(isc_socket_t *sock0) { + + REQUIRE(VALID_SOCKET(sock)); + +- REQUIRE(isc_refcount_current(&sock->references) == 1); +- /* +- * We don't need to retain the lock hereafter, since no one else has +- * this socket. +- */ ++ LOCK(&sock->lock); ++ ++ REQUIRE(isc_refcount_current(&sock->references) >= 1); + REQUIRE(sock->fd == -1); + REQUIRE(sock->threadid == -1); + + result = opensocket(sock->manager, sock, NULL); ++ ++ UNLOCK(&sock->lock); ++ + if (result != ISC_R_SUCCESS) { + sock->fd = -1; + } else {