]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
net/mlx5e: Avoid using the ipv6 stub in the TC offload neigh update path
authorOr Gerlitz <ogerlitz@mellanox.com>
Tue, 13 Mar 2018 19:43:43 +0000 (21:43 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 12 Apr 2018 10:31:19 +0000 (12:31 +0200)
commit07c70edfbefd49fe2a74847ceabcec543f651cfa
treec22f55e5a59de4da1c45c97ed732be19766e54f5
parent5075e98fb92f58084d91ca3b50bd7d8a421e60e1
net/mlx5e: Avoid using the ipv6 stub in the TC offload neigh update path

[ Upstream commit 423c9db29943cfc43e3a408192e9efa4178af6a1 ]

Currently we use the global ipv6_stub var to access the ipv6 global
nd table. This practice gets us to troubles when the stub is only partially
set e.g when ipv6 is loaded under the disabled policy. In this case, as of commit
343d60aada5a ("ipv6: change ipv6_stub_impl.ipv6_dst_lookup to take net argument")
the stub is not null, but stub->nd_tbl is and we crash.

As we can access the ipv6 nd_tbl directly, the fix is just to avoid the
reference through the stub. There is one place in the code where we
issue ipv6 route lookup and keep doing it through the stub, but that
mentioned commit makes sure we get -EAFNOSUPPORT from the stack.

Fixes: 232c001398ae ("net/mlx5e: Add support to neighbour update flow")
Signed-off-by: Or Gerlitz <ogerlitz@mellanox.com>
Reviewed-by: Aviv Heller <avivh@mellanox.com>
Signed-off-by: Saeed Mahameed <saeedm@mellanox.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/net/ethernet/mellanox/mlx5/core/en_rep.c
drivers/net/ethernet/mellanox/mlx5/core/en_tc.c