linux/drivers/net/ethernet/intel/ixgbe
John Fastabend 51f3773bde ixgbe: deleting dfwd stations out of order can cause null ptr deref
The number of stations in use is kept in the num_rx_pools counter
in the ixgbe_adapter structure. This is in turn used by the queue
allocation scheme to determine how many queues are needed to support
the number of pools in use with the current feature set.

This works as long as the pools are added and destroyed in order
because (num_rx_pools * queues_per_pool) is equal to the last
queue in use by a pool. But as soon as you delete a pool out of
order this is no longer the case. So the above multiplication
allocates to few queues and a pool may reference a ring that has
not been allocated/initialized.

To resolve use the bit mask of in use pools to determine the final
pool being used and allocate enough queues so that we don't
inadvertently remove its queues.

# ip link add link eth2 \
	numtxqueues 4 numrxqueues 4 txqueuelen 50 type macvlan
# ip link set dev macvlan0 up
# ip link add link eth2 \
	numtxqueues 4 numrxqueues 4 txqueuelen 50 type macvlan
# ip link set dev macvlan1 up
# for i in {0..100}; do
  ip link set dev macvlan0 down; ip link set dev macvlan0 up;
  done;

Signed-off-by: John Fastabend <john.r.fastabend@intel.com>
Acked-by: Neil Horman <nhorman@tuxdriver.com>
Acked-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2013-11-08 15:21:08 -05:00
..
ixgbe_82598.c ixgbe: add support for quad-port x520 adapter 2013-07-31 02:26:15 -07:00
ixgbe_82599.c ixgbe: add 1Gbps support for QSFP+ 2013-08-29 03:24:00 -07:00
ixgbe_common.c ixgbe: Check return value on eeprom reads 2013-08-29 02:45:38 -07:00
ixgbe_common.h ixgbe: Check return value on eeprom reads 2013-08-29 02:45:38 -07:00
ixgbe_dcb_82598.c ixgbe: Fix Tx Hang issue with lldpad on 82598EB 2013-07-28 13:17:17 -07:00
ixgbe_dcb_82598.h ixgbe: update date to 2013 2013-02-05 01:44:13 -08:00
ixgbe_dcb_82599.c ixgbe: update date to 2013 2013-02-05 01:44:13 -08:00
ixgbe_dcb_82599.h IXGBE: Set the SW prio_tc values at initialization to the HW setting. 2013-05-21 03:14:21 -07:00
ixgbe_dcb_nl.c IXGBE: Set the SW prio_tc values at initialization to the HW setting. 2013-05-21 03:14:21 -07:00
ixgbe_dcb.c IXGBE: Set the SW prio_tc values at initialization to the HW setting. 2013-05-21 03:14:21 -07:00
ixgbe_dcb.h IXGBE: Set the SW prio_tc values at initialization to the HW setting. 2013-05-21 03:14:21 -07:00
ixgbe_debugfs.c ixgbe: update date to 2013 2013-02-05 01:44:13 -08:00
ixgbe_ethtool.c ixgbe: fix rx-usecs range checks for BQL 2013-10-24 07:03:12 -07:00
ixgbe_fcoe.c drivers: net: Remove remaining alloc/OOM messages 2013-02-08 17:44:39 -05:00
ixgbe_fcoe.h ixgbe: update date to 2013 2013-02-05 01:44:13 -08:00
ixgbe_lib.c ixgbe: enable l2 forwarding acceleration for macvlans 2013-11-07 19:11:41 -05:00
ixgbe_main.c ixgbe: deleting dfwd stations out of order can cause null ptr deref 2013-11-08 15:21:08 -05:00
ixgbe_mbx.c ixgbe: update date to 2013 2013-02-05 01:44:13 -08:00
ixgbe_mbx.h ixgbe: update date to 2013 2013-02-05 01:44:13 -08:00
ixgbe_phy.c ixgbe: add support for older QSFP active DA cables 2013-08-29 03:36:55 -07:00
ixgbe_phy.h ixgbe: Cleanup the use of tabs and spaces 2013-10-01 12:49:49 -04:00
ixgbe_ptp.c ixgbe: fix lockdep annotation issue for ptp's work item 2013-07-31 01:00:57 -07:00
ixgbe_sriov.c ixgbe: enable l2 forwarding acceleration for macvlans 2013-11-07 19:11:41 -05:00
ixgbe_sriov.h ixgbe: update date to 2013 2013-02-05 01:44:13 -08:00
ixgbe_sysfs.c ixgbe: update date to 2013 2013-02-05 01:44:13 -08:00
ixgbe_type.h ixgbe: ethtool DCB registers dump for 82599 and x540 2013-10-01 12:49:49 -04:00
ixgbe_x540.c ixgbe: Cleanup the use of tabs and spaces 2013-10-01 12:49:49 -04:00
ixgbe.h ixgbe: enable l2 forwarding acceleration for macvlans 2013-11-07 19:11:41 -05:00
Makefile ixgbe: update date to 2013 2013-02-05 01:44:13 -08:00