mirror_ubuntu-kernels/drivers/net/ethernet/marvell
Vladimir Oltean c35b57ceff net: switchdev: zero-initialize struct switchdev_notifier_fdb_info emitted by drivers towards the bridge
The blamed commit added a new field to struct switchdev_notifier_fdb_info,
but did not make sure that all call paths set it to something valid.
For example, a switchdev driver may emit a SWITCHDEV_FDB_ADD_TO_BRIDGE
notifier, and since the 'is_local' flag is not set, it contains junk
from the stack, so the bridge might interpret those notifications as
being for local FDB entries when that was not intended.

To avoid that now and in the future, zero-initialize all
switchdev_notifier_fdb_info structures created by drivers such that all
newly added fields to not need to touch drivers again.

Fixes: 2c4eca3ef7 ("net: bridge: switchdev: include local flag in FDB notifications")
Reported-by: Ido Schimmel <idosch@idosch.org>
Signed-off-by: Vladimir Oltean <vladimir.oltean@nxp.com>
Reviewed-by: Ido Schimmel <idosch@nvidia.com>
Tested-by: Ido Schimmel <idosch@nvidia.com>
Reviewed-by: Leon Romanovsky <leonro@nvidia.com>
Reviewed-by: Karsten Graul <kgraul@linux.ibm.com>
Link: https://lore.kernel.org/r/20210810115024.1629983-1-vladimir.oltean@nxp.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
2021-08-10 13:22:57 -07:00
..
mvpp2 net: mvvp2: fix short frame size on s390 2021-08-06 12:09:42 +01:00
octeontx2 octeontx2-af: Do NIX_RX_SW_SYNC twice 2021-07-27 11:52:11 +01:00
prestera net: switchdev: zero-initialize struct switchdev_notifier_fdb_info emitted by drivers towards the bridge 2021-08-10 13:22:57 -07:00
Kconfig net: marvell: Remove reference to CONFIG_MV64X60 2021-03-18 14:19:39 -07:00
Makefile net: marvell: prestera: Add driver for Prestera family ASIC devices 2020-09-17 16:35:46 -07:00
mv643xx_eth.c of: net: pass the dst buffer to of_get_mac_address() 2021-04-13 14:35:02 -07:00
mvmdio.c net: mdiobus: withdraw fwnode_mdbiobus_register 2021-06-25 11:46:29 -07:00
mvneta_bm.c net: mvneta: use devm_platform_ioremap_resource() to simplify code 2019-08-21 13:52:33 -07:00
mvneta_bm.h net: mvneta: make stub functions static inline 2019-10-25 16:21:48 -07:00
mvneta.c net: marvell: always set skb_shared_info in mvneta_swbm_add_rx_fragment 2021-07-03 13:50:21 -07:00
pxa168_eth.c net: pxa168_eth: Fix a potential data race in pxa168_eth_remove 2021-06-18 12:08:39 -07:00
skge.c net: marvell: Fix an alignment problem 2021-03-29 13:23:59 -07:00
skge.h net: marvell: remove leading spaces before tabs 2021-05-19 12:17:31 -07:00
sky2.c skbuff: add a parameter to __skb_frag_unref 2021-06-07 14:11:47 -07:00
sky2.h net: marvell: remove leading spaces before tabs 2021-05-19 12:17:31 -07:00