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.boy...@twc.com

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

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

Modified: stable/10/sys/contrib/ipfilter/netinet/ip_nat.c
==============================================================================
--- stable/10/sys/contrib/ipfilter/netinet/ip_nat.c     Wed Feb 13 20:13:40 
2019        (r344112)
+++ stable/10/sys/contrib/ipfilter/netinet/ip_nat.c     Thu Feb 14 00:52:03 
2019        (r344113)
@@ -1909,20 +1909,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;
 }
_______________________________________________
svn-src-stable-10@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-stable-10
To unsubscribe, send any mail to "svn-src-stable-10-unsubscr...@freebsd.org"

Reply via email to