svn commit: r343591 - head/sys/contrib/ipfilter/netinet

Cy Schubert cy at FreeBSD.org
Wed Jan 30 20:23:17 UTC 2019


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 at 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;
 }


More information about the svn-src-all mailing list