svn commit: r326033 - head/sys/net

Stephen Hurd shurd at FreeBSD.org
Mon Nov 20 21:57:05 UTC 2017


Author: shurd
Date: Mon Nov 20 21:57:04 2017
New Revision: 326033
URL: https://svnweb.freebsd.org/changeset/base/326033

Log:
  Fix off-by-one error in bit_nclear() usage
  
  bit_nclear() takes the bit numbers for the start and end bits, not the start
  and a count.  This was resulting in memory corruption past the end of the
  bitstr_t.
  
  Sponsored by:	Limelight Networks

Modified:
  head/sys/net/iflib.c

Modified: head/sys/net/iflib.c
==============================================================================
--- head/sys/net/iflib.c	Mon Nov 20 21:56:25 2017	(r326032)
+++ head/sys/net/iflib.c	Mon Nov 20 21:57:04 2017	(r326033)
@@ -2025,7 +2025,7 @@ iflib_fl_setup(iflib_fl_t fl)
 	if_ctx_t ctx = rxq->ifr_ctx;
 	if_softc_ctx_t sctx = &ctx->ifc_softc_ctx;
 
-	bit_nclear(fl->ifl_rx_bitmap, 0, fl->ifl_size);
+	bit_nclear(fl->ifl_rx_bitmap, 0, fl->ifl_size - 1);
 	/*
 	** Free current RX buffer structs and their mbufs
 	*/


More information about the svn-src-head mailing list