diff options
author | Vlad Buslov | 2020-08-31 16:17:29 +0300 |
---|---|---|
committer | Saeed Mahameed | 2020-11-05 12:17:05 -0800 |
commit | 78c906e430b13d30a8cfbdef4ccbbe1686841a9e (patch) | |
tree | dc75b4406c800eb11ff1e55bb1821e419a0ceb72 /virt | |
parent | e68e28b4a9d71261e3f8fd05a72d6cf0b443a493 (diff) |
net/mlx5e: Protect encap route dev from concurrent release
In functions mlx5e_route_lookup_ipv{4|6}() route_dev can be arbitrary net
device and not necessary mlx5 eswitch port representor. As such, in order
to ensure that route_dev is not destroyed concurrent the code needs either
explicitly take reference to the device before releasing reference to
rtable instance or ensure that caller holds rtnl lock. First approach is
chosen as a fix since rtnl lock dependency was intentionally removed from
mlx5 TC layer.
To prevent unprotected usage of route_dev in encap code take a reference to
the device before releasing rt. Don't save direct pointer to the device in
mlx5_encap_entry structure and use ifindex instead. Modify users of
route_dev pointer to properly obtain the net device instance from its
ifindex.
Fixes: 61086f391044 ("net/mlx5e: Protect encap hash table with mutex")
Fixes: 6707f74be862 ("net/mlx5e: Update hw flows when encap source mac changed")
Signed-off-by: Vlad Buslov <vladbu@nvidia.com>
Reviewed-by: Roi Dayan <roid@nvidia.com>
Signed-off-by: Saeed Mahameed <saeedm@nvidia.com>
Diffstat (limited to 'virt')
0 files changed, 0 insertions, 0 deletions