lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <aPouFMQsE48tkse9@horms.kernel.org>
Date: Thu, 23 Oct 2025 14:31:00 +0100
From: Simon Horman <horms@...nel.org>
To: Tariq Toukan <tariqt@...dia.com>
Cc: Eric Dumazet <edumazet@...gle.com>, Jakub Kicinski <kuba@...nel.org>,
	Paolo Abeni <pabeni@...hat.com>,
	Andrew Lunn <andrew+netdev@...n.ch>,
	"David S. Miller" <davem@...emloft.net>,
	Saeed Mahameed <saeedm@...dia.com>,
	Leon Romanovsky <leon@...nel.org>, Mark Bloch <mbloch@...dia.com>,
	netdev@...r.kernel.org, linux-rdma@...r.kernel.org,
	linux-kernel@...r.kernel.org, Gal Pressman <gal@...dia.com>,
	Carolina Jubran <cjubran@...dia.com>,
	Dragos Tatulea <dtatulea@...dia.com>
Subject: Re: [PATCH net-next 2/7] net/mlx5e: Use TIR API in
 mlx5e_modify_tirs_lb()

On Thu, Oct 23, 2025 at 09:43:35AM +0300, Tariq Toukan wrote:

...

> diff --git a/drivers/net/ethernet/mellanox/mlx5/core/en_common.c b/drivers/net/ethernet/mellanox/mlx5/core/en_common.c
> index 376a018b2db1..fad6b761f622 100644
> --- a/drivers/net/ethernet/mellanox/mlx5/core/en_common.c
> +++ b/drivers/net/ethernet/mellanox/mlx5/core/en_common.c
> @@ -250,43 +250,30 @@ void mlx5e_destroy_mdev_resources(struct mlx5_core_dev *mdev)
>  int mlx5e_modify_tirs_lb(struct mlx5_core_dev *mdev, bool enable_uc_lb,
>  			 bool enable_mc_lb)

...

>  	list_for_each_entry(tir, &mdev->mlx5e_res.hw_objs.td.tirs_list, list) {
> -		tirn = tir->tirn;
> -		err = mlx5_core_modify_tir(mdev, tirn, in);
> +		err = mlx5e_tir_modify(tir, builder);
>  		if (err)
>  			break;
>  	}
>  	mutex_unlock(&mdev->mlx5e_res.hw_objs.td.list_lock);
>  
> -	kvfree(in);
> +	mlx5e_tir_builder_free(builder);
>  	if (err)
>  		mlx5_core_err(mdev,
>  			      "modify tir(0x%x) enable_lb uc(%d) mc(%d) failed, %d\n",
> -			      tirn,
> +			      mlx5e_tir_get_tirn(tir),

Sorry, for not noticing this before sending my previous email.

Coccinelle complains about the line above like this:

.../en_common.c:276:28-31: ERROR: invalid reference to the index variable of the iterator on line 265

I think this is a false positive because the problem only occurs if
the list iteration runs to completion. But err guards against
tir being used in that case.

But, perhaps, to be on the safe side, it would be good practice
to stash tir somewhere?

>  			      enable_uc_lb, enable_mc_lb, err);
>  
>  	return err;
> -- 
> 2.31.1
> 
> 

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ