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] [thread-next>] [day] [month] [year] [list]
Date:   Wed, 18 Jan 2023 13:45:56 -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-next 11/15] net/mlx5e: Warn when destroying mod hdr hash
 table that is not empty



On 1/18/2023 10:35 AM, Saeed Mahameed wrote:
> From: Roi Dayan <roid@...dia.com>
> 
> To avoid memory leaks add a warn when destroying mod hdr hash table
> but the hash table is not empty.
> 

Strictly this is to help catch a memory leak, as the WARN_ON itself
doesn't prevent any leaking.. It does make it much easier to spot though.

Reviewed-by: Jacob Keller <jacob.e.keller@...el.com>

> Signed-off-by: Roi Dayan <roid@...dia.com>
> Reviewed-by: Maor Dickman <maord@...dia.com>
> Signed-off-by: Saeed Mahameed <saeedm@...dia.com>
> ---
>  drivers/net/ethernet/mellanox/mlx5/core/en/mod_hdr.c | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/drivers/net/ethernet/mellanox/mlx5/core/en/mod_hdr.c b/drivers/net/ethernet/mellanox/mlx5/core/en/mod_hdr.c
> index 17325c5d6516..cf60f0a3ff23 100644
> --- a/drivers/net/ethernet/mellanox/mlx5/core/en/mod_hdr.c
> +++ b/drivers/net/ethernet/mellanox/mlx5/core/en/mod_hdr.c
> @@ -47,6 +47,7 @@ void mlx5e_mod_hdr_tbl_init(struct mod_hdr_tbl *tbl)
>  
>  void mlx5e_mod_hdr_tbl_destroy(struct mod_hdr_tbl *tbl)
>  {
> +	WARN_ON(!hash_empty(tbl->hlist));
>  	mutex_destroy(&tbl->lock);
>  }
>  

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ