Date: Tue, 28 Feb 2006 19:59:13 +0100 (CET) From: Antoine Brodin <antoine.brodin@laposte.net> To: FreeBSD-gnats-submit@FreeBSD.org Subject: kern/93952: [netgraph][patch] memory leak in ng_tcpmss.c Message-ID: <200602281859.k1SIxDep005052@barton.dreadbsd.org> Resent-Message-ID: <200602281900.k1SJ0JOo083241@freefall.freebsd.org>
next in thread | raw e-mail | index | archive | help
>Number: 93952 >Category: kern >Synopsis: [netgraph][patch] memory leak in ng_tcpmss.c >Confidential: no >Severity: non-critical >Priority: low >Responsible: freebsd-bugs >State: open >Quarter: >Keywords: >Date-Required: >Class: sw-bug >Submitter-Id: current-users >Arrival-Date: Tue Feb 28 19:00:18 GMT 2006 >Closed-Date: >Last-Modified: >Originator: Antoine Brodin >Release: FreeBSD 7.0-CURRENT i386 >Organization: none >Environment: System: FreeBSD barton.dreadbsd.org 7.0-CURRENT FreeBSD 7.0-CURRENT #0: Wed Feb 22 20:15:40 CET 2006 antoine@barton.dreadbsd.org:/usr/obj/usr/src/sys/BARTON i386 >Description: This problem concerns ng_tcpmss(4). On hook disconnection, the per hook info which contains the output hook and the hook stats is not freed. >How-To-Repeat: Use the example in ng_tcpmss man page, shutdown and unload everything, then vmstat -m | grep netgraph >Fix: --- ng_tcpmss.c.diff begins here --- Index: sys/netgraph/ng_tcpmss.c =================================================================== RCS file: /home/ncvs/src/sys/netgraph/ng_tcpmss.c,v retrieving revision 1.2 diff -u -p -r1.2 ng_tcpmss.c --- sys/netgraph/ng_tcpmss.c 10 Jun 2005 12:44:21 -0000 1.2 +++ sys/netgraph/ng_tcpmss.c 28 Feb 2006 18:02:03 -0000 @@ -368,6 +368,8 @@ ng_tcpmss_disconnect(hook_p hook) priv->outHook = NULL; } + FREE(NG_HOOK_PRIVATE(hook), M_NETGRAPH); + NG_HOOK_SET_PRIVATE(hook, NULL); if (NG_NODE_NUMHOOKS(NG_HOOK_NODE(hook)) == 0) ng_rmnode_self(NG_HOOK_NODE(hook)); --- ng_tcpmss.c.diff ends here --- >Release-Note: >Audit-Trail: >Unformatted:
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200602281859.k1SIxDep005052>