summaryrefslogtreecommitdiffstats
path: root/sys/dev/ixgbe
diff options
context:
space:
mode:
authorjfv <jfv@FreeBSD.org>2009-07-24 16:57:49 +0000
committerjfv <jfv@FreeBSD.org>2009-07-24 16:57:49 +0000
commita5f235cd3b5e7e2d8c30a93d72dba463c3090eef (patch)
treeaab2390622c80c4ce068415debcb768e2f3e388b /sys/dev/ixgbe
parenta3c94456b574c6f3cdb965fcc48b00d6a0a72ee1 (diff)
downloadFreeBSD-src-a5f235cd3b5e7e2d8c30a93d72dba463c3090eef.zip
FreeBSD-src-a5f235cd3b5e7e2d8c30a93d72dba463c3090eef.tar.gz
This delta fixes two bugs:
- When a vlan event occurs a check was not made that the event was actually for the interface, thus resulting in a panic. All three drivers have this vulnerability. Add a check for this condition. - Secondly, there was a duplicate buf_ring free in the em driver resulting in a panic on unload. Remove. Approved by: re
Diffstat (limited to 'sys/dev/ixgbe')
-rw-r--r--sys/dev/ixgbe/ixgbe.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/sys/dev/ixgbe/ixgbe.c b/sys/dev/ixgbe/ixgbe.c
index fb8d6e5..6396769 100644
--- a/sys/dev/ixgbe/ixgbe.c
+++ b/sys/dev/ixgbe/ixgbe.c
@@ -2961,7 +2961,8 @@ ixgbe_free_transmit_buffers(struct tx_ring *txr)
}
}
#if __FreeBSD_version >= 800000
- buf_ring_free(txr->br, M_DEVBUF);
+ if (txr->br != NULL)
+ buf_ring_free(txr->br, M_DEVBUF);
#endif
if (txr->tx_buffers != NULL) {
free(txr->tx_buffers, M_DEVBUF);
@@ -4128,6 +4129,9 @@ ixgbe_register_vlan(void *unused, struct ifnet *ifp, u16 vtag)
struct adapter *adapter = ifp->if_softc;
u16 index, bit;
+ if (ifp->if_init != ixgbe_init) /* Not our event */
+ return;
+
if ((vtag == 0) || (vtag > 4095)) /* Invalid */
return;
@@ -4150,6 +4154,9 @@ ixgbe_unregister_vlan(void *unused, struct ifnet *ifp, u16 vtag)
struct adapter *adapter = ifp->if_softc;
u16 index, bit;
+ if (ifp->if_init != ixgbe_init)
+ return;
+
if ((vtag == 0) || (vtag > 4095)) /* Invalid */
return;
OpenPOWER on IntegriCloud