aboutsummaryrefslogtreecommitdiff
path: root/sys/net/iflib.c
diff options
context:
space:
mode:
authorStephen Hurd <shurd@FreeBSD.org>2017-11-20 21:57:04 +0000
committerStephen Hurd <shurd@FreeBSD.org>2017-11-20 21:57:04 +0000
commit7274b2f6bef598b2fec0025bdd05a8974c9ad85f (patch)
tree180454182ecfdc49b8d171e479a43fc1e8a3ea25 /sys/net/iflib.c
parent8d68f9d430105e18bd7246235957dffd13cd1049 (diff)
downloadsrc-7274b2f6bef598b2fec0025bdd05a8974c9ad85f.tar.gz
src-7274b2f6bef598b2fec0025bdd05a8974c9ad85f.zip
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
Notes
Notes: svn path=/head/; revision=326033
Diffstat (limited to 'sys/net/iflib.c')
-rw-r--r--sys/net/iflib.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/sys/net/iflib.c b/sys/net/iflib.c
index 7a0952be650e..c1ee25d5c0d4 100644
--- a/sys/net/iflib.c
+++ b/sys/net/iflib.c
@@ -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
*/