[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <AM0PR05MB48665232E60A046B83AC86F2D16A0@AM0PR05MB4866.eurprd05.prod.outlook.com>
Date: Thu, 24 Oct 2019 20:29:22 +0000
From: Parav Pandit <parav@...lanox.com>
To: Saeed Mahameed <saeedm@...lanox.com>,
"David S. Miller" <davem@...emloft.net>
CC: "netdev@...r.kernel.org" <netdev@...r.kernel.org>
Subject: RE: [net 06/11] net/mlx5: Fix rtable reference leak
> -----Original Message-----
> From: Saeed Mahameed <saeedm@...lanox.com>
> Sent: Thursday, October 24, 2019 2:39 PM
> To: David S. Miller <davem@...emloft.net>
> Cc: netdev@...r.kernel.org; Parav Pandit <parav@...lanox.com>; Saeed
> Mahameed <saeedm@...lanox.com>
> Subject: [net 06/11] net/mlx5: Fix rtable reference leak
>
> From: Parav Pandit <parav@...lanox.com>
>
> If the rt entry gateway family is not AF_INET for multipath device, rtable
> reference is leaked.
> Hence, fix it by releasing the reference.
>
> Fixes: 5fb091e8130b ("net/mlx5e: Use hint to resolve route when in HW
> multipath mode")
> Fixes: e32ee6c78efa ("net/mlx5e: Support tunnel encap over tagged Ethernet")
> Signed-off-by: Parav Pandit <parav@...lanox.com>
> Signed-off-by: Saeed Mahameed <saeedm@...lanox.com>
> ---
> drivers/net/ethernet/mellanox/mlx5/core/en/tc_tun.c | 12 +++++++++---
> 1 file changed, 9 insertions(+), 3 deletions(-)
>
> diff --git a/drivers/net/ethernet/mellanox/mlx5/core/en/tc_tun.c
> b/drivers/net/ethernet/mellanox/mlx5/core/en/tc_tun.c
> index f8ee18b4da6f..13af72556987 100644
> --- a/drivers/net/ethernet/mellanox/mlx5/core/en/tc_tun.c
> +++ b/drivers/net/ethernet/mellanox/mlx5/core/en/tc_tun.c
> @@ -97,15 +97,19 @@ static int mlx5e_route_lookup_ipv4(struct mlx5e_priv
> *priv,
> if (ret)
> return ret;
>
> - if (mlx5_lag_is_multipath(mdev) && rt->rt_gw_family != AF_INET)
> + if (mlx5_lag_is_multipath(mdev) && rt->rt_gw_family != AF_INET) {
> + ip_rt_put(rt);
> return -ENETUNREACH;
> + }
> #else
> return -EOPNOTSUPP;
> #endif
>
> ret = get_route_and_out_devs(priv, rt->dst.dev, route_dev, out_dev);
> - if (ret < 0)
> + if (ret < 0) {
> + ip_rt_put(rt);
> return ret;
> + }
>
> if (!(*out_ttl))
> *out_ttl = ip4_dst_hoplimit(&rt->dst); @@ -149,8 +153,10 @@
> static int mlx5e_route_lookup_ipv6(struct mlx5e_priv *priv,
> *out_ttl = ip6_dst_hoplimit(dst);
>
> ret = get_route_and_out_devs(priv, dst->dev, route_dev, out_dev);
> - if (ret < 0)
> + if (ret < 0) {
> + dst_release(dst);
> return ret;
> + }
> #else
> return -EOPNOTSUPP;
> #endif
> --
> 2.21.0
This patch is missing two RB signatures that we had in internal review.
Reviewed-by: Daniel Jurgens <danielj@...lanox.com>
Reviewed-by: Mark Bloch <markb@...lanox.com>
Powered by blists - more mailing lists