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
This commit is contained in:
Lawrence Stewart 2014-08-19 02:19:53 +00:00
parent 4ec7371233
commit 8b0fe327e8

View File

@ -221,6 +221,7 @@ static VNET_DEFINE(uint32_t, cdg_hold_backoff);
/* 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. */
@ -277,6 +279,14 @@ cdg_mod_init(void)
return (0);
}
static int
cdg_mod_destroy(void)
{
uma_zdestroy(qdiffsample_zone);
return (0);
}
static int
cdg_cb_init(struct cc_var *ccv)
{