]> git.baikalelectronics.ru Git - kernel.git/commit
net/mlx5: E-Switch, Fix access to invalid memory when toggling esw modes
authorRoi Dayan <roid@mellanox.com>
Thu, 7 Mar 2019 07:27:18 +0000 (09:27 +0200)
committerSaeed Mahameed <saeedm@mellanox.com>
Fri, 29 Mar 2019 19:24:42 +0000 (12:24 -0700)
commit2d35bb00a96299cd270f886659f4e6394bf89663
tree7121a193b397b6e05fee9bf244fd4c4a4c61e8bb
parent28d697d61a522d819374a220eb15ab382e2e72de
net/mlx5: E-Switch, Fix access to invalid memory when toggling esw modes

The esw fdb table has a union of legacy and offloads members.
So if we were in a certain esw mode we could set some memebers and not
set null which is fine as on destroy path and don't care.
But then moving from legacy to switchdev a second time, the cleanup flow
of legacy mode checks if a struct member was in use if it's not null so
we need to make sure to reset the code to null when we init legacy mode.

Fixes: 6295bd0760db ("net/mlx5: E-Switch, Add support for VEPA in legacy mode.")
Signed-off-by: Roi Dayan <roid@mellanox.com>
Reviewed-by: Huy Nguyen <huyn@mellanox.com>
Signed-off-by: Saeed Mahameed <saeedm@mellanox.com>
drivers/net/ethernet/mellanox/mlx5/core/eswitch.c