linux-hardened/drivers/net/ethernet
Shani Michaelli fe1ff29dd4 net/mlx4_en: Protect MAC address modification with the state_lock mutex
This Patches solves an issue that could raise when modifying the
device's MAC. It occurs due to a simultaneous access to priv->mac_hash
from two contexts. The buggy scenario described below:
Context 1: copy the new mac address to the dev->dev_addr field.
Context 2: mlx4_en_do_uc_filter removes prev_mac entry from the mac_hash
           db since it is not in dev->uc and not equal to dev->dev_addr.
Context 1: mlx4_en_do_set_mac() calls mlx4_en_replace_mac() to replace
           prev_mac with dev_addr but it fails to update the mac_hash db
           since it no longer contains prev_mac, therefore it returns
           with an error.

The fix is to prevent mlx4_en_do_uc_filter from being executed by both
of the context 1 calls described above, This is done by putting them
both under the mdev->state_lock lock, it will solve this issue since
mlx4_en_do_uc_filter is already protected by the mdev->state_lock.

Reviewed-by: Eyal Perry <eyalpe@mellanox.com>
Signed-off-by: Shani Michaeli <shanim@mellanox.com>
Signed-off-by: Amir Vadai <amirv@mellanox.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2014-05-14 15:40:33 -04:00
..
3com net: get rid of SET_ETHTOOL_OPS 2014-05-13 17:43:20 -04:00
8390 net/apne: replace IS_ERR and PTR_ERR with PTR_ERR_OR_ZERO 2014-04-12 01:59:38 -04:00
adaptec net: get rid of SET_ETHTOOL_OPS 2014-05-13 17:43:20 -04:00
adi bfin_mac: remove empty MDIO bus reset function 2014-03-28 01:38:02 -04:00
aeroflex net: greth: remove empty MDIO bus reset function 2014-03-28 01:38:01 -04:00
allwinner net: sun4i-emac: add promiscuous support 2014-04-12 01:59:38 -04:00
alteon net: get rid of SET_ETHTOOL_OPS 2014-05-13 17:43:20 -04:00
altera net: get rid of SET_ETHTOOL_OPS 2014-05-13 17:43:20 -04:00
amd net: get rid of SET_ETHTOOL_OPS 2014-05-13 17:43:20 -04:00
apple
arc arc_emac: add netpoll support 2014-05-13 18:02:24 -04:00
atheros net: get rid of SET_ETHTOOL_OPS 2014-05-13 17:43:20 -04:00
broadcom tg3: Update copyright and version to 3.137 2014-05-13 18:38:51 -04:00
brocade net: get rid of SET_ETHTOOL_OPS 2014-05-13 17:43:20 -04:00
cadence net: macb: Fix race between HW and driver 2014-05-05 17:11:18 -04:00
calxeda net: get rid of SET_ETHTOOL_OPS 2014-05-13 17:43:20 -04:00
chelsio net: get rid of SET_ETHTOOL_OPS 2014-05-13 17:43:20 -04:00
cirrus cs89x0: Call dev_consume_skb_any instead of dev_kfree_skb. 2014-03-24 21:18:58 -07:00
cisco net: get rid of SET_ETHTOOL_OPS 2014-05-13 17:43:20 -04:00
davicom dm9000: Call dev_consume_skb_any instead of dev_kfree_skb. 2014-03-24 21:18:59 -07:00
dec net: get rid of SET_ETHTOOL_OPS 2014-05-13 17:43:20 -04:00
dlink net: get rid of SET_ETHTOOL_OPS 2014-05-13 17:43:20 -04:00
emulex net: get rid of SET_ETHTOOL_OPS 2014-05-13 17:43:20 -04:00
faraday net: get rid of SET_ETHTOOL_OPS 2014-05-13 17:43:20 -04:00
freescale net: get rid of SET_ETHTOOL_OPS 2014-05-13 17:43:20 -04:00
fujitsu net: get rid of SET_ETHTOOL_OPS 2014-05-13 17:43:20 -04:00
hp
i825xx i825xx: Call dev_kfree_skb_any instead of dev_kfree_skb. 2014-03-24 21:19:02 -07:00
ibm net: get rid of SET_ETHTOOL_OPS 2014-05-13 17:43:20 -04:00
icplus net: get rid of SET_ETHTOOL_OPS 2014-05-13 17:43:20 -04:00
intel net: get rid of SET_ETHTOOL_OPS 2014-05-13 17:43:20 -04:00
marvell net: get rid of SET_ETHTOOL_OPS 2014-05-13 17:43:20 -04:00
mellanox net/mlx4_en: Protect MAC address modification with the state_lock mutex 2014-05-14 15:40:33 -04:00
micrel net: get rid of SET_ETHTOOL_OPS 2014-05-13 17:43:20 -04:00
microchip net: get rid of SET_ETHTOOL_OPS 2014-05-13 17:43:20 -04:00
moxa
myricom net: get rid of SET_ETHTOOL_OPS 2014-05-13 17:43:20 -04:00
natsemi net: get rid of SET_ETHTOOL_OPS 2014-05-13 17:43:20 -04:00
neterion net: get rid of SET_ETHTOOL_OPS 2014-05-13 17:43:20 -04:00
nuvoton
nvidia net: get rid of SET_ETHTOOL_OPS 2014-05-13 17:43:20 -04:00
nxp
octeon
oki-semi net: get rid of SET_ETHTOOL_OPS 2014-05-13 17:43:20 -04:00
packetengines net: get rid of SET_ETHTOOL_OPS 2014-05-13 17:43:20 -04:00
pasemi
qlogic net: get rid of SET_ETHTOOL_OPS 2014-05-13 17:43:20 -04:00
rdc r6040: remove empty MDIO bus reset function 2014-03-28 01:38:02 -04:00
realtek net: get rid of SET_ETHTOOL_OPS 2014-05-13 17:43:20 -04:00
renesas sh_eth: replace devm_kzalloc() with devm_kmalloc_array() 2014-05-13 18:51:27 -04:00
samsung net: get rid of SET_ETHTOOL_OPS 2014-05-13 17:43:20 -04:00
seeq
sfc net: get rid of SET_ETHTOOL_OPS 2014-05-13 17:43:20 -04:00
sgi
silan sc92031: Call dev_consume_skb_any instead of dev_kfree_skb. 2014-03-24 21:19:08 -07:00
sis net: get rid of SET_ETHTOOL_OPS 2014-05-13 17:43:20 -04:00
smsc net: get rid of SET_ETHTOOL_OPS 2014-05-13 17:43:20 -04:00
stmicro net: get rid of SET_ETHTOOL_OPS 2014-05-13 17:43:20 -04:00
sun net: cassini: use nested lock annotation 2014-05-09 16:34:10 -04:00
tehuti net: get rid of SET_ETHTOOL_OPS 2014-05-13 17:43:20 -04:00
ti net: get rid of SET_ETHTOOL_OPS 2014-05-13 17:43:20 -04:00
tile tilepro: Call dev_consume_skb_any instead of kfree_skb. 2014-03-24 21:19:12 -07:00
toshiba spider_net: Call dev_consume_skb_any instead of dev_kfree_skb. 2014-03-24 21:19:13 -07:00
tundra
via net: via-rhine: Convert #ifdef USE_MMIO to a runtime flag 2014-05-05 15:36:41 -04:00
wiznet net: w5100: Use devm_ioremap_resource() 2014-02-28 16:57:24 -05:00
xilinx net: emaclite: remove empty MDIO bus reset function 2014-03-28 01:38:02 -04:00
xircom
xscale net: ptp: move PTP classifier in its own file 2014-04-01 16:43:18 -04:00
dnet.c dnet: remove empty MDIO bus reset function 2014-03-28 01:38:02 -04:00
dnet.h
ec_bhf.c Driver for Beckhoff CX5020 EtherCAT master module. 2014-05-08 22:59:25 -04:00
ethoc.c net: ethoc: remove ethoc_config 2014-04-21 14:58:48 -04:00
fealnx.c
jme.c jme: Fix DMA unmap warning 2014-05-07 15:54:14 -04:00
jme.h
Kconfig Driver for Beckhoff CX5020 EtherCAT master module. 2014-05-08 22:59:25 -04:00
korina.c
lantiq_etop.c netdevice: add queue selection fallback handler for ndo_select_queue 2014-02-17 00:36:34 -05:00
Makefile Driver for Beckhoff CX5020 EtherCAT master module. 2014-05-08 22:59:25 -04:00
netx-eth.c
s6gmac.c