net/mlx5e: Use flow keys dissector to parse packets for ARFS
authorMaxim Mikityanskiy <maximmi@mellanox.com>
Fri, 5 Jul 2019 14:59:28 +0000 (17:59 +0300)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sun, 25 Aug 2019 08:51:52 +0000 (10:51 +0200)
commit4aa2734ced922da3ffa5f4a93473a21c98466c1b
treed59ae895a76bba19930f935c40f8eb8b73d19ac7
parente2d8229bba1bc6f61d5bca1a97dedf4da947e312
net/mlx5e: Use flow keys dissector to parse packets for ARFS

[ Upstream commit 405b93eb764367a670e729da18e54dc42db32620 ]

The current ARFS code relies on certain fields to be set in the SKB
(e.g. transport_header) and extracts IP addresses and ports by custom
code that parses the packet. The necessary SKB fields, however, are not
always set at that point, which leads to an out-of-bounds access. Use
skb_flow_dissect_flow_keys() to get the necessary information reliably,
fix the out-of-bounds access and reuse the code.

Fixes: 18c908e477dc ("net/mlx5e: Add accelerated RFS support")
Signed-off-by: Maxim Mikityanskiy <maximmi@mellanox.com>
Reviewed-by: Tariq Toukan <tariqt@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_arfs.c