[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <2c518cf8-0c32-0052-ffc0-6b5d78b143e0@intel.com>
Date: Mon, 28 Nov 2022 15:26:05 -0800
From: Jacob Keller <jacob.e.keller@...el.com>
To: Saeed Mahameed <saeed@...nel.org>,
"David S. Miller" <davem@...emloft.net>,
Jakub Kicinski <kuba@...nel.org>,
Paolo Abeni <pabeni@...hat.com>,
Eric Dumazet <edumazet@...gle.com>
CC: Saeed Mahameed <saeedm@...dia.com>, <netdev@...r.kernel.org>,
Tariq Toukan <tariqt@...dia.com>, Roi Dayan <roid@...dia.com>,
Maor Dickman <maord@...dia.com>
Subject: Re: [net 05/15] net/mlx5e: Fix use-after-free when reverting
termination table
On 11/24/2022 12:10 AM, Saeed Mahameed wrote:
> From: Roi Dayan <roid@...dia.com>
>
> When having multiple dests with termination tables and second one
> or afterwards fails the driver reverts usage of term tables but
> doesn't reset the assignment in attr->dests[num_vport_dests].termtbl
> which case a use-after-free when releasing the rule.
> Fix by resetting the assignment of termtbl to null.
>
Reviewed-by: Jacob Keller <jacob.e.keller@...el.com>
> Fixes: 10caabdaad5a ("net/mlx5e: Use termination table for VLAN push actions")
> Signed-off-by: Roi Dayan <roid@...dia.com>
> Reviewed-by: Maor Dickman <maord@...dia.com>
> Signed-off-by: Saeed Mahameed <saeedm@...dia.com>
> ---
> .../net/ethernet/mellanox/mlx5/core/eswitch_offloads_termtbl.c | 2 ++
> 1 file changed, 2 insertions(+)
>
> diff --git a/drivers/net/ethernet/mellanox/mlx5/core/eswitch_offloads_termtbl.c b/drivers/net/ethernet/mellanox/mlx5/core/eswitch_offloads_termtbl.c
> index 108a3503f413..edd910258314 100644
> --- a/drivers/net/ethernet/mellanox/mlx5/core/eswitch_offloads_termtbl.c
> +++ b/drivers/net/ethernet/mellanox/mlx5/core/eswitch_offloads_termtbl.c
> @@ -312,6 +312,8 @@ mlx5_eswitch_add_termtbl_rule(struct mlx5_eswitch *esw,
> for (curr_dest = 0; curr_dest < num_vport_dests; curr_dest++) {
> struct mlx5_termtbl_handle *tt = attr->dests[curr_dest].termtbl;
>
> + attr->dests[curr_dest].termtbl = NULL;
> +
> /* search for the destination associated with the
> * current term table
> */
Powered by blists - more mailing lists