Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 18 Mar 2017 01:37:20 +0000 (UTC)
From:      Kristof Provost <kp@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r315469 - head/sys/netpfil/pf
Message-ID:  <201703180137.v2I1bK4R051371@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: kp
Date: Sat Mar 18 01:37:20 2017
New Revision: 315469
URL: https://svnweb.freebsd.org/changeset/base/315469

Log:
  pf: Fix memory leak on vnet shutdown or unload
  
  Rules are unlinked in shutdown_pf(), so we must call
  pf_unload_vnet_purge(), which frees unlinked rules, after that, not
  before.
  
  Reviewed by:	eri, bz
  Differential Revision:	https://reviews.freebsd.org/D10040

Modified:
  head/sys/netpfil/pf/pf_ioctl.c

Modified: head/sys/netpfil/pf/pf_ioctl.c
==============================================================================
--- head/sys/netpfil/pf/pf_ioctl.c	Sat Mar 18 00:53:24 2017	(r315468)
+++ head/sys/netpfil/pf/pf_ioctl.c	Sat Mar 18 01:37:20 2017	(r315469)
@@ -3766,12 +3766,12 @@ pf_unload_vnet(void)
 		return;
 	}
 
-	pf_unload_vnet_purge();
-
 	PF_RULES_WLOCK();
 	shutdown_pf();
 	PF_RULES_WUNLOCK();
 
+	pf_unload_vnet_purge();
+
 	pf_normalize_cleanup();
 	PF_RULES_WLOCK();
 	pfi_cleanup_vnet();



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