Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 7 Mar 2013 04:42:20 +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: r247906 - head/sys/netinet
Message-ID:  <201303070442.r274gKgW008463@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: lstewart
Date: Thu Mar  7 04:42:20 2013
New Revision: 247906
URL: http://svnweb.freebsd.org/changeset/base/247906

Log:
  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.
  
  MFC after:	3 days

Modified:
  head/sys/netinet/siftr.c

Modified: head/sys/netinet/siftr.c
==============================================================================
--- head/sys/netinet/siftr.c	Thu Mar  7 02:53:29 2013	(r247905)
+++ head/sys/netinet/siftr.c	Thu Mar  7 04:42:20 2013	(r247906)
@@ -1314,7 +1314,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?201303070442.r274gKgW008463>