Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 19 Aug 2014 02:19:54 +0000 (UTC)
From:      Lawrence Stewart <lstewart@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r270160 - head/sys/netinet/cc
Message-ID:  <201408190219.s7J2JsF0035284@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: lstewart
Date: Tue Aug 19 02:19:53 2014
New Revision: 270160
URL: http://svnweb.freebsd.org/changeset/base/270160

Log:
  Destroy the "qdiffsample_zone" UMA zone on unload to avoid a use-after-unload
  panic easily triggered by running "sysctl -a" after unload.
  
  Reported and tested by:	Grenville Armitage <garmitage@swin.edu.au>
  MFC after:	1 week

Modified:
  head/sys/netinet/cc/cc_cdg.c

Modified: head/sys/netinet/cc/cc_cdg.c
==============================================================================
--- head/sys/netinet/cc/cc_cdg.c	Tue Aug 19 01:20:24 2014	(r270159)
+++ head/sys/netinet/cc/cc_cdg.c	Tue Aug 19 02:19:53 2014	(r270160)
@@ -221,6 +221,7 @@ static VNET_DEFINE(uint32_t, cdg_hold_ba
 
 /* Function prototypes. */
 static int cdg_mod_init(void);
+static int cdg_mod_destroy(void);
 static void cdg_conn_init(struct cc_var *ccv);
 static int cdg_cb_init(struct cc_var *ccv);
 static void cdg_cb_destroy(struct cc_var *ccv);
@@ -234,7 +235,8 @@ struct cc_algo cdg_cc_algo = {
 	.cb_destroy = cdg_cb_destroy,
 	.cb_init = cdg_cb_init,
 	.conn_init = cdg_conn_init,
-	.cong_signal = cdg_cong_signal
+	.cong_signal = cdg_cong_signal,
+	.mod_destroy = cdg_mod_destroy
 };
 
 /* Vnet created and being initialised. */
@@ -278,6 +280,14 @@ cdg_mod_init(void)
 }
 
 static int
+cdg_mod_destroy(void)
+{
+
+	uma_zdestroy(qdiffsample_zone);
+	return (0);
+}
+
+static int
 cdg_cb_init(struct cc_var *ccv)
 {
 	struct cdg *cdg_data;



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