Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 11 Mar 2013 08:21:44 +0000 (UTC)
From:      Lawrence Stewart <lstewart@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org
Subject:   svn commit: r248150 - stable/8/sys/netinet
Message-ID:  <201303110821.r2B8LiA6053400@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: lstewart
Date: Mon Mar 11 08:21:43 2013
New Revision: 248150
URL: http://svnweb.freebsd.org/changeset/base/248150

Log:
  MFC r247906:
  
  The hashmask returned by hashinit() is a valid index in the returned
  hash array. Fix a siftr(4) potential memory leak and INVARIANTS
  triggered kernel panic in hashdestroy() by ensuring the last array index
  in the flow counter hash table is flushed of entries.
  
  Approved by:	re (kib)

Modified:
  stable/8/sys/netinet/siftr.c
Directory Properties:
  stable/8/sys/   (props changed)
  stable/8/sys/netinet/   (props changed)

Modified: stable/8/sys/netinet/siftr.c
==============================================================================
--- stable/8/sys/netinet/siftr.c	Mon Mar 11 07:55:49 2013	(r248149)
+++ stable/8/sys/netinet/siftr.c	Mon Mar 11 08:21:43 2013	(r248150)
@@ -1319,7 +1319,7 @@ siftr_manage_ops(uint8_t action)
 		 * flow seen and freeing any malloc'd memory.
 		 * The hash consists of an array of LISTs (man 3 queue).
 		 */
-		for (i = 0; i < siftr_hashmask; i++) {
+		for (i = 0; i <= siftr_hashmask; i++) {
 			LIST_FOREACH_SAFE(counter, counter_hash + i, nodes,
 			    tmp_counter) {
 				key = counter->key;



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