Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 14 Feb 2019 00:52:03 +0000 (UTC)
From:      Cy Schubert <cy@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org
Subject:   svn commit: r344113 - in stable: 10/sys/contrib/ipfilter/netinet 11/sys/contrib/ipfilter/netinet 12/sys/contrib/ipfilter/netinet
Message-ID:  <201902140052.x1E0q3OH066822@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: cy
Date: Thu Feb 14 00:52:03 2019
New Revision: 344113
URL: https://svnweb.freebsd.org/changeset/base/344113

Log:
  MFC r343591:
  
  Do not obtain an already held read lock. This causes a witness panic when
  ipfs is invoked. This is the second of two panics resolving PR 235110.
  
  PR:		235110
  Reported by:	David.Boyd49@twc.com

Modified:
  stable/11/sys/contrib/ipfilter/netinet/ip_nat.c
Directory Properties:
  stable/11/   (props changed)

Changes in other areas also in this revision:
Modified:
  stable/10/sys/contrib/ipfilter/netinet/ip_nat.c
  stable/12/sys/contrib/ipfilter/netinet/ip_nat.c
Directory Properties:
  stable/10/   (props changed)
  stable/12/   (props changed)

Modified: stable/11/sys/contrib/ipfilter/netinet/ip_nat.c
==============================================================================
--- stable/11/sys/contrib/ipfilter/netinet/ip_nat.c	Wed Feb 13 20:13:40 2019	(r344112)
+++ stable/11/sys/contrib/ipfilter/netinet/ip_nat.c	Thu Feb 14 00:52:03 2019	(r344113)
@@ -1904,20 +1904,16 @@ ipf_nat_getent(softc, data, getlock)
 		}
 	}
 	if (error == 0) {
-		if (getlock) {
-			READ_ENTER(&softc->ipf_nat);
-			getlock = 0;
-		}
 		error = ipf_outobjsz(softc, data, ipn, IPFOBJ_NATSAVE,
 				     ipns.ipn_dsize);
 	}
 
 finished:
-	if (getlock) {
-		READ_ENTER(&softc->ipf_nat);
-	}
 	if (ipn != NULL) {
 		KFREES(ipn, ipns.ipn_dsize);
+	}
+	if (getlock) {
+		RWLOCK_EXIT(&softc->ipf_nat);
 	}
 	return error;
 }



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