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]
Message-ID: <20180608232117.GF12577@ziepe.ca>
Date:   Fri, 8 Jun 2018 17:21:17 -0600
From:   Jason Gunthorpe <jgg@...pe.ca>
To:     "Gustavo A. R. Silva" <gustavo@...eddedor.com>
Cc:     Raed Salem <raeds@...lanox.com>, Leon Romanovsky <leon@...nel.org>,
        Doug Ledford <dledford@...hat.com>, linux-rdma@...r.kernel.org,
        linux-kernel@...r.kernel.org
Subject: Re: [PATCH] IB/mlx5: Fix memory leak in mlx5_ib_create_flow

On Fri, Jun 08, 2018 at 06:11:49PM -0500, Gustavo A. R. Silva wrote:
> 
> >>  	mutex_lock(&dev->flow_db->lock);
> >>@@ -3640,6 +3646,9 @@ static struct ib_flow *mlx5_ib_create_flow(struct ib_qp *qp,
> >>  	kfree(ucmd);
> >>  	kfree(handler);
> >>  	return ERR_PTR(err);
> >>+free_ucmd:
> >>+	kfree(ucmd);
> >>+	return ERR_PTR(err);
> >>  }
> >
> >This hunk is a bit wonky, can we do this instead? handle never needs
> >to be freed.
> >
> >destroy_ft:
> >	put_flow_table(dev, ft_prio, false);
> >	if (ft_prio_tx)
> >		put_flow_table(dev, ft_prio_tx, false);
> >unlock:
> >	mutex_unlock(&dev->flow_db->lock);
> >	kfree(dst);
> >free_ucmd:
> >	kfree(ucmd);
> >	return ERR_PTR(err);
> >}
> >
> >
> 
> Sure thing. I'll send v2 shortly.

I made the adjustment for you, if it is wrong let me know..

https://git.kernel.org/pub/scm/linux/kernel/git/rdma/rdma.git/commit/?h=wip/jgg-for-rc&id=2cc82dd58712888758c2d2b405d012f2cd580dd7

Jason

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ