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:   Fri, 21 Aug 2020 10:39:19 -0300
From:   Jason Gunthorpe <jgg@...pe.ca>
To:     Håkon Bugge <haakon.bugge@...cle.com>
Cc:     Dinghao Liu <dinghao.liu@....edu.cn>, kjlu@....edu,
        Doug Ledford <dledford@...hat.com>,
        Yishai Hadas <yishaih@...lanox.com>,
        Leon Romanovsky <leon@...nel.org>,
        Michel Lespinasse <walken@...gle.com>,
        Ariel Elior <ariel.elior@...vell.com>,
        Michal Kalderon <michal.kalderon@...vell.com>,
        OFED mailing list <linux-rdma@...r.kernel.org>,
        linux-kernel@...r.kernel.org
Subject: Re: [PATCH] IB/uverbs: Fix memleak in ib_uverbs_add_one

On Fri, Aug 21, 2020 at 11:47:32AM +0200, Håkon Bugge wrote:
> 
> 
> > On 21 Aug 2020, at 10:10, Dinghao Liu <dinghao.liu@....edu.cn> wrote:
> > 
> > When ida_alloc_max() fails, uverbs_dev should be freed
> > just like when init_srcu_struct() fails. It's the same
> > for the error paths after this call.
> > 
> > Signed-off-by: Dinghao Liu <dinghao.liu@....edu.cn>
> > drivers/infiniband/core/uverbs_main.c | 1 +
> > 1 file changed, 1 insertion(+)
> > 
> > diff --git a/drivers/infiniband/core/uverbs_main.c b/drivers/infiniband/core/uverbs_main.c
> > index 37794d88b1f3..c6b4e3e2aff6 100644
> > +++ b/drivers/infiniband/core/uverbs_main.c
> > @@ -1170,6 +1170,7 @@ static int ib_uverbs_add_one(struct ib_device *device)
> > 		ib_uverbs_comp_dev(uverbs_dev);
> > 	wait_for_completion(&uverbs_dev->comp);
> > 	put_device(&uverbs_dev->dev);
> > +	kfree(uverbs_dev);
> 
> Isn't this taken care of by the *release* function pointer, which
> happens to be ib_uverbs_release_dev() ?

Yep

Jason

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ