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 for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <6e00918130708cdc8eb6cbf77333ef92567675bc.camel@mellanox.com>
Date:   Thu, 11 Jun 2020 22:08:50 +0000
From:   Saeed Mahameed <saeedm@...lanox.com>
To:     "efremov@...ux.com" <efremov@...ux.com>,
        "eric.dumazet@...il.com" <eric.dumazet@...il.com>
CC:     "kuba@...nel.org" <kuba@...nel.org>,
        "netdev@...r.kernel.org" <netdev@...r.kernel.org>,
        "leon@...nel.org" <leon@...nel.org>,
        "linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH] net/mlx5: Use kfree(ft->g) in arfs_create_groups()

On Fri, 2020-06-05 at 12:57 -0700, Eric Dumazet wrote:
> 
> On 6/5/20 12:22 PM, Denis Efremov wrote:
> > Use kfree() instead of kvfree() on ft->g in arfs_create_groups()
> > because
> > the memory is allocated with kcalloc().
> > 
> > Signed-off-by: Denis Efremov <efremov@...ux.com>
> > ---
> >  drivers/net/ethernet/mellanox/mlx5/core/en_arfs.c | 2 +-
> >  1 file changed, 1 insertion(+), 1 deletion(-)
> > 
> > diff --git a/drivers/net/ethernet/mellanox/mlx5/core/en_arfs.c
> > b/drivers/net/ethernet/mellanox/mlx5/core/en_arfs.c
> > index 014639ea06e3..c4c9d6cda7e6 100644
> > --- a/drivers/net/ethernet/mellanox/mlx5/core/en_arfs.c
> > +++ b/drivers/net/ethernet/mellanox/mlx5/core/en_arfs.c
> > @@ -220,7 +220,7 @@ static int arfs_create_groups(struct
> > mlx5e_flow_table *ft,
> >  			sizeof(*ft->g), GFP_KERNEL);
> >  	in = kvzalloc(inlen, GFP_KERNEL);
> >  	if  (!in || !ft->g) {
> > -		kvfree(ft->g);
> > +		kfree(ft->g);
> >  		kvfree(in);
> >  		return -ENOMEM;
> >  	}
> > 
> 
> This is slow path, kvfree() is perfectly able to free memory that was
> kmalloc()ed
> 
> net-next is closed, can we avoid these patches during merge window ?

I agree, with Eric, better if we wait for net-next to open.

I will apply this once net-next is open. 

Thanks,
Saeed.

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ