Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 30 Jan 2019 20:23:16 +0000 (UTC)
From:      Cy Schubert <cy@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r343591 - head/sys/contrib/ipfilter/netinet
Message-ID:  <201901302023.x0UKNGQB053229@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: cy
Date: Wed Jan 30 20:23:16 2019
New Revision: 343591
URL: https://svnweb.freebsd.org/changeset/base/343591

Log:
  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
  MFC after:	2 weeks

Modified:
  head/sys/contrib/ipfilter/netinet/ip_nat.c

Modified: head/sys/contrib/ipfilter/netinet/ip_nat.c
==============================================================================
--- head/sys/contrib/ipfilter/netinet/ip_nat.c	Wed Jan 30 20:22:33 2019	(r343590)
+++ head/sys/contrib/ipfilter/netinet/ip_nat.c	Wed Jan 30 20:23:16 2019	(r343591)
@@ -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?201901302023.x0UKNGQB053229>